↓↑ Program 1#include↓↑ Program 2struct node { int x; struct node *next; }; int main() { /* This will be the unchanging first node */ struct node *root; /* Now root points to a node struct */ root = (struct node *) malloc( sizeof(struct node) ); /* The node root points to has its next pointer equal to a null pointer set */ root->next = 0; /* By using the -> operator, you can modify what the node, a pointer, (root in this case) points to. */ root->x = 5; } #includestruct node { int x; struct node *next; }; int main() { /* This will be the unchanging first node */ struct node *root; /* Now root points to a node struct */ root = (struct node *) malloc( sizeof(struct node) ); /* The node root points to has its next pointer equal to a null pointer set */ root->next = 0; /* By using the -> operator, you can modify what the node, a pointer, (root in this case) points to. */ root->x = 5; }
C++ Assignment and Tutorial
This blog focus on systematic learning of c++ language for that i have added very basic assignments from low difficulty level to high difficulty level and advance and basic c++ concept which will be helpful for fresher as well as experienced.
Sunday, July 6, 2014
cpp assignments
Subscribe to:
Comments (Atom)