Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <string.h>
- #include <stdlib.h>
- struct Timie
- {
- char im[30];
- struct Timie *nast;
- };
- int main()
- {
- struct Timie *pocz, *wsk1, *wsk2;
- char imie[30];
- pocz = NULL;
- puts("podaj imie:");
- gets_s(imie, 30);
- while (imie[0] != '\0') // jeśli wpisaana wartośc rozna od pustej
- {
- wsk1 = malloc(sizeof(struct Timie));
- strcpy_s(wsk1->im, 30 ,imie); // secure dodaje ilośc znaków
- wsk1->nast = pocz;
- pocz = wsk1;
- puts("podaj imie:");
- gets_s(imie, 30);
- }
- // wyswietlanie
- while (wsk1 != NULL)
- {
- puts(wsk1->im);
- wsk1 = wsk1->nast;
- system("PAUSE");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement