Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- struct student {
- char nazwisko [40];
- int nr;
- struct student *p;
- };
- void wypisz (struct student *wskaznik) {
- printf ("\n\n\n");
- while (wskaznik != NULL) {
- printf ("%s%d\n", wskaznik->nazwisko, wskaznik->nr);
- wskaznik = wskaznik->p;
- };
- };
- int main (void) {
- struct student *head = NULL;
- struct student *tmp = (struct student *)malloc (sizeof (struct student));
- fgets (tmp->nazwisko, 40, stdin);
- scanf ("%d", &tmp->nr);
- tmp->p = NULL;
- head = tmp;
- wypisz (head);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement