I have program like (from link text)
FILE* soubor;
char buffer[100];
soubor = fopen("file","r");
string outp = "";
while (! feof(soubor))
{
fgets(buffer,100,soubor);
fputs (buffer , stdout);
}
fclose(soubor);
and file like
A
B
C
D
E
and the output of program is
A
B
C
D
E
E
it repeats last line of file twice. I have this problem in other programs too.