Advertisement
Guest User

Untitled

a guest
Apr 4th, 2020
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.01 KB | None | 0 0
  1. znak[0] = 0;
  2.     char c = 0;
  3.     while (znak[poc_matic] != '\n')
  4.     {
  5.         if((A = realloc(A, (poc_matic +1) * sizeof(matice))) == NULL)
  6.         {
  7.             uvolni_pamat(A, poc_matic);
  8.             free (znak);
  9.             return 100;
  10.         }
  11.        
  12.         if((znak = realloc(znak, (poc_matic + 2) * sizeof(char))) == NULL)
  13.         {
  14.             uvolni_pamat(A, poc_matic);
  15.             free (znak);
  16.             return 100;
  17.         }
  18.         znak[poc_matic] = nacitaj_maticu(&A[poc_matic]);
  19.         if (znak[poc_matic] == 100)
  20.         {
  21.             printf("chyba");
  22.             uvolni_pamat(A, poc_matic+1);
  23.             free(znak);
  24.             return 100;
  25.         }
  26.         else if (znak[poc_matic] == 101)
  27.         {
  28.             printf("chyba");
  29.             uvolni_pamat(A, poc_matic);
  30.             free(znak);
  31.             return 100;
  32.         }
  33.         znak[poc_matic] = getchar();
  34.         znak[poc_matic + 1] = getchar();
  35.         printf("ttt %c\n", znak[poc_matic]);
  36.         poc_matic++;
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement