Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. void dodaj(struct student** lista, struct student* nowa)
  2. {
  3. while (*lista != NULL) lista = &((*lista)->next);
  4. *lista = nowa;
  5. nowa->next = NULL;
  6. }
  7.  
  8. void dodajstudenta(struct student* lista)
  9. {
  10. struct student* nowa = malloc(sizeof(st));
  11.  
  12. printf("\t Nazwisko: ");
  13. scanf("%s", &nowa->nazwisko);
  14.  
  15. printf("\t Imie: ");
  16. scanf("%s", &nowa->imie);
  17.  
  18. printf("\t Indeks: ");
  19. scanf("%d", &(nowa->indeks));
  20.  
  21. nowa->ocena = 0;
  22.  
  23. printf("\t Wiek: ");
  24. scanf("%d", &nowa->wiek);
  25.  
  26. dodaj(lista, nowa);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement