Advertisement
Guest User

aitai bolse maybe

a guest
Nov 11th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1.  
  2. #include<stdio.h>
  3. #include<stdlib.h>
  4. typedef struct ptr
  5. {
  6. int x;
  7. struct ptr *pt;
  8. }ptr;
  9. ptr *head=NULL;
  10. int main()
  11. {
  12. ptr *a=(ptr*)malloc(sizeof(ptr));
  13. a->pt=NULL;
  14. a->x=01;
  15. head=a;
  16. ptr *b=(ptr*)malloc(sizeof(ptr));
  17. b->pt=NULL;
  18. b->x=02;
  19. a->pt=b;
  20. ptr *c=(ptr*)malloc(sizeof(ptr));
  21. c->pt=NULL;
  22. c->x=03;
  23. b->pt=c;
  24. ptr *d=(ptr*)malloc(sizeof(ptr));
  25. d->x=05;
  26. c->pt=d;
  27. d->pt=head;
  28.  
  29.  
  30. return 0;
  31.  
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement