Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. struct element {
  4. float wzrost;
  5.  
  6. struct element *nast;
  7. };
  8. typedef struct element ELEMENT;
  9. typedef ELEMENT *ADRES;
  10.  
  11. void stworz_element(ADRES *pocz)
  12. {
  13. ADRES nowy;
  14. nowy=(ADRES)malloc(sizeof(ELEMENT));
  15. nowy->wzrost=wzrost;
  16. if (*pocz==NULL)
  17. nowy->nast=NULL;
  18. else nowy->nast=(*pocz);
  19. (*pocz)=nowy;
  20. }
  21.  
  22. void wypisz (ADRES lista){
  23. while (lista->nast!=NULL)
  24. {
  25. printf("%d",lista->wzrost);
  26. lista=lista->nast;
  27. }
  28. printf ("%f",lista->wzrost);
  29. }
  30. int main()
  31. {
  32. stworz_element(&lista);
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement