binary file parsing in C++

Segher Boessenkool
Thu Dec 11 18:49:00 GMT 2003

On 11-dec-03, at 0:20, Justin Findlay wrote:
> I am perplexed at what is happening here.  This is a simple script that
> reads a file one byte at a time, and writes it to another file one 
> byte at
> a time, but somehow there is an extra character at the end of the 
> output
> file.

end-of-file only gets set after you try to read past the end of the 
not when you are _at_ the end of the file.


More information about the Gcc-help mailing list