Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. struct clasa{
  5. char nume[256];
  6. int id;
  7. struct elev *elevi;
  8. struct clasa *urm;
  9. };
  10. struct elev{
  11. char nume[256];
  12. struct elev *urm;
  13. };
  14. struct clasa *start = NULL;
  15.  
  16. void adauga_clasa(char nume[256], int id)
  17. {
  18. struct clasa *t;
  19. t = (struct clasa*)malloc(sizeof(struct clasa));
  20. t->id=id;
  21. t->urm = NULL;
  22. strcpy(t->nume,nume);
  23. if(start == NULL)
  24. {
  25. start = t;
  26. return;
  27. }
  28. t->urm = start;
  29. start = t;
  30. }
  31.  
  32. int main()
  33. {
  34. printf("Hello world\n");
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement