I have a little problem with reading data from file.
I need to read the name, lastname and phone number.
But the data is separated by '|'.
file e.g.
Matthew | McConaughey | 684299275
Humphrey | Bogart | 204050673
Mary | Tyler Moore | 503462885
Loretta | Young | 416211713
I wrote this function
char name[20];
char lastname[40];
int number;
while(!feof(plik)){
int hpl=fscanf(filename, "%s | %s | %d", name, lastname, &number);
}
I have problem when in the file are two-member lastname like 'Tyler Moore', then fscanf return 2
I don't know how I can read them
That is possible to use one fscanf() function ?