Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void contact_from_file_to_list(s_linked_list *self) {
- FILE *file = fopen("test.txt", "r");
- int sym;
- s_contact *contact = contact_new();
- while(1) {
- sym = getc(file);
- contact_read(contact, file);
- list_push_back(self, contact);
- contact_print(self->head->data);
- if (sym == EOF) {
- if(feof(file) != 0)
- break;
- }
- }
- fclose(file);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement