Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- using namespace std;
- struct list{
- int data;
- struct list *next;
- };
- int main() {
- struct list *node;
- struct list *temp;
- node = new list();
- node->data = 100;
- node->next = NULL;
- temp = new list();
- temp->data = 200;
- temp->next = NULL;
- node->next = temp;
- // temp = new list();
- node->next->next = new list();
- node->next->next->data = 300;
- cout<<node->data;
- cout<<node->next->data;
- cout<<node->next->next->data;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement