This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Strange Behavior
- From: John Love-Jensen <eljay at adobe dot com>
- To: Eric Lemings <lemings at roguewave dot com>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Thu, 08 Mar 2007 14:10:01 -0600
- Subject: 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