daily pastebin goal
13%
SHARE
TWEET

Untitled

a guest Dec 16th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void contact_from_file_to_list(s_linked_list *self) {
  2.     FILE *file = fopen("test.txt", "r");
  3.  
  4.     int sym;
  5.  
  6.     s_contact *contact = contact_new();
  7.     while(1) {
  8.         sym = getc(file);
  9.  
  10.         contact_read(contact, file);
  11.         list_push_back(self, contact);
  12.         contact_print(self->head->data);
  13.         if (sym == EOF) {
  14.             if(feof(file) != 0)
  15.                 break;
  16.         }
  17.     }
  18.     fclose(file);
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top