Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class node
- {
- public:
- string data;
- node * next;
- };
- int main()
- {
- node * A;
- A = new node;
- (*A).data = "node1";
- node * B;
- B = new node;
- (*B).data = "node2";
- node * C;
- C = new node;
- (*C).data = "node3";
- (*A).next = B;
- (*B).next = C;
- (*C).next = NULL;
- for(int i=0; *(next) != NULL; i++)
- {
- cout << *next[i[] << endl;
- }
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment