I am writing a C program and I am saving data in a text file and then I am trying to retrieve that data. The Text file looks like this:
Name Date Price Office Construct...
Darrin 3/14/11 56.99 LM Wood...
....
So i use fgets( ) to get one line of text and save it as a char array. Then i am suing sscanf("%s %s....); to retrieve all the different data from the array. The problem is for some reason when I use sscanf it will read the first 3 pieces of data then it will skip one and read the rest. Is is an over flow problem? Is there anything else I can use to read the string? Here is what part of my code looks like:
char sentence[500];
fgets(sentence,500,myfile);
sscanf(sentence,"%s%s%s%s%s",tempId,tempPrice,tempDate,myOffice,tempSold);