This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Strange Behavior


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]