Advertisement
ahmad_zizo

Untitled

Dec 25th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. FILE *pb;
  2. int counter=0;
  3.  
  4. void Load()
  5. {
  6. int i=0;
  7. pb = fopen("phonebook.txt","r");
  8. if(pb==NULL)
  9. printf("no such file");
  10. else
  11. {
  12. while(!feof(pb))
  13. {
  14. fscanf(pb,"%[^,],%[^,],%[^,],%[^,],%s\n",person[counter].fname,person[counter].lname,person[counter].address,person[counter].city,person[counter].number);
  15. counter++;
  16. }
  17. }
  18. fclose(pb);
  19. printf("contacts have been loaded");
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement