I'm using feof() C function to know whether I am at the end of my file or not, but it seems that it never returns -1 even when I reach the end of the file..
here is what I do :
do {
j+= fscanf(base, "%f %f %f %d", &a, &b, &c, &d);
another stuff here....
}while(!feof(file))
I notice that it doesen't work as I have another condition which is if(j!=4) then signal a problem, my file is all good, the problem is that when it's finished I still go in another iteration which cause j = -4 as nothing can be read and my error occures..
Any ideas ? Thank you all !