Re: Tricky cout with 0x0A value

From: Jean-Gael GRICOURT (jgricourt_at_free.fr)
Date: 02/02/04


Date: 2 Feb 2004 02:58:48 -0800

Thank you all for your prompt replies. I finally found out what was
wrong. "Cout" involves an OS dependent IO operation. On the Win32
plateform it has the side effect I've described in my previous post.
So I added the necessary code to change this default behaviour to make
sure that the output will be binary:

#ifdef _WIN32
 #include <io.h>
 #include <fcntl.h>
#endif

[...]

#ifdef _WIN32
 _setmode(_fileno(stdin), _O_BINARY);
 _setmode(_fileno(stdout), _O_BINARY);
#endif

end of the story ...



Relevant Pages