Strange Behavior
John Love-Jensen
eljay@adobe.com
Thu Mar 8 20:48:00 GMT 2007
Hi Eric,
The istream_iterator uses >> operator.
You have the std::ios_base::skipws flag set in your ifstream named 'in'
(since the ios_base::skipws is set by default, and you haven't cleared it).
Add a line to your main() to clear the skipws flag:
ifstream in ("logo.gif", ios_base::binary);:
in.unsetf(ios_base::skipws); // <-- Add this line.
The results still differ between your C++ and your C version.
I'm not sure if the bug in your C++ or C version, though.
HTH,
--Eljay
More information about the Gcc-help
mailing list