Mail Archives: djgpp/1996/06/13/14:33:01
Hi,
In djgpp V1, in Borland C, or in UNIX gnu C (Sun), I use a statement as:
while (fscanf(archive,"%s",str1)!=EOF) {...}
to read all the nonblank lines in a file. "str1" receives the first item
as a string of characters, and is used to define what are the other items
that are read by other fscanf statements.
When the end of the file is reached, fscanf returns EOF and the loop
terminates.
In djgpp V2 this is apparently not happening. fscanf reads again and again
an empty line after the last item read...
Exactly the same code works with the other compilers.
Is this some bug, or am I doing something "nonstandard"?
Thanks,
Antonio Carlos M. de Queiroz
- Raw text -