Advertisement
salron3

Zapis vuv fail

May 30th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. void psn(lst *head, FILE *fp)
  2. {
  3.     if (head == NULL)
  4.     {
  5.         printf("The list is empty");
  6.         return;
  7.     }
  8.  
  9.     int err = 0;
  10.     while (head != NULL)
  11.     {
  12.         if (err = fprintf(fp, "%s\n", head->data.name) != 1)
  13.             printf("Greshka pri zapis\n");
  14.  
  15.         if (err = fprintf(fp, "%d\n", head->data.num) != 1)
  16.             printf("Greshka pri zapis\n");
  17.  
  18.         if (err = fprintf(fp, "%f\n", head->data.cht) != 1)
  19.             printf("Greshka pri zapis\n");
  20.  
  21.         head = head->next;
  22.     }
  23.  
  24.     if (fp)
  25.         fclose(fp);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement