My program doesn't read the last line of my file, if I have something like this in my text file:
1 T1 6 Saint-Etienne 42100 20 rue Maurice Renard
0 T3 15 Île-de-France 91300 50 rue du Gue Jacquet
It would only print the first line, the fix to this is adding a random line at the end so it can print the lines I need.
code:
int chargeLogement(FILE * fe, Logement **log,int max)
{
Logement l;
int i=0;
l=lireLogement(fe);
while(!feof(fe))
{
/* Load content of txt file using malloc & array, and i++ when the first array is filled */
}
return i; //number of lines
}