How do i read the end of the line in a txt or dat file? I treid using fscanf in a while loop like this
Code:
while(fscanf(pfile,"%c") != EOF && fscanf(pfile,"%c") != '\n')
{
char c = ' ';
fscanf(pfile,"%c",&c);
str += c;
}
The reason why its important to stop after each line is that i need the program to read the data from each line separately. It would be great if someone could tell me would i am doing wrong,How i can fix it and What i should use to do this. I have searched everywhere on the c++ ref site and the internet on how to do this but i just cant find anything and if i can it just does int make any sense.