i am having this problem of extracting data out from txt file being seperated by ¨;¨.
How is your day?;Fine
Where are you now?;At your house
My code is as follow:
if ( fp == 0 )
printf( "Could not open file\n" );
while(fgets(fileInput, sizeof fileInput, fp))
if(sscanf(fileInput, "%s,%s", &ques[i], &ans[i]) == 2)
fclose( fp );
The difficulties i faced was that i am not able to successfully extract the data out from the text file and stored it into both que and ans.
Errors keep coming out from the "%s,%s". And i guess i might have key in the wrong placeholders..
Anyone can help ? Thanks in advance...