Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FILE *pb;
- int counter=0;
- void Load()
- {
- int i=0;
- pb = fopen("phonebook.txt","r");
- if(pb==NULL)
- printf("no such file");
- else
- {
- while(!feof(pb))
- {
- fscanf(pb,"%[^,],%[^,],%[^,],%[^,],%s\n",person[counter].fname,person[counter].lname,person[counter].address,person[counter].city,person[counter].number);
- counter++;
- }
- }
- fclose(pb);
- printf("contacts have been loaded");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement