Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <stdlib.h>
- using namespace std;
- struct n {
- int x;
- n * next;
- };
- typedef n node;
- int main ()
- {
- int var;
- node * root;
- root = (node *)malloc(sizeof(node));
- node * iter;
- iter = root;
- for(int i=0;i<5;i++){
- iter->x = i;
- iter = iter->next;
- }
- for(int j=0;j<5;j++){
- var = iter->x;
- cout<<var;
- iter = iter->next;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement