Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. void pobieranie()
  2. {
  3. int *tab,*pom;
  4. tab = malloc(sizeof(int));
  5. int liczba = 1,i=1;
  6. while (liczba != 0)
  7. {
  8. scanf("%d", &liczba);
  9. while (getc(stdin) != '\n') {}
  10. tab[i] = liczba;
  11. pom = realloc(tab, (i + 2) * sizeof(int));
  12. tab = pom;
  13. i++;
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement