Advertisement
zodiak1

Untitled

Feb 9th, 2022
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. struct list
  5. {
  6.    char v = 0;
  7.    list *n = NULL;
  8. };
  9.  
  10. int main()
  11. {
  12.    list *p = new list {1, new list};
  13.    p->n = new list { 2, new list };
  14.    p->n->n = new list { 3, NULL };
  15.  
  16.    list t = *(p);
  17.    delete p;
  18.    p = t.n;
  19.  
  20.    return 0 * _getch();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement