Re: Strange Behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux