Mail Archives: djgpp/1998/09/14/18:01:27
Arnold K. Poon wrote:
> The program is suppose to read each line and print that out.
> However, when I use DJGPP to compile, I got an extra line of output. The
> EOF variable was NOT set to ZERO after reading file, therefore the while
> loop enters 1 more time and print out some bogus output.
>
> However, if i compile with MSVC++5.0 (default workspace), I did not
> get this problem.
>
> Am I using EOF correctly? or is there something different between
> MSVC and DJGPP compiler?
EOF is not set to true until an attempt to retreive a variable FAILS. This
does not happen until AFTER the last line is entered. If you changed it to
say "file.peek()!=EOF", then that will likely work.
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT GeoCities DOT com
Endlis AT nbnet DOT nb DOT ca
- Raw text -