This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: \n to \r\n in stdout
- From: John Love-Jensen <eljay at adobe dot com>
- To: <thales at virtualbs dot com dot br>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Mon, 07 Nov 2005 06:24:36 -0600
- Subject: Re: \n to \r\n in stdout
Hi Thales,
> I'm trying to open a binary file and print it to the stdout, but substituting
'\n' for "\r\n", the file generated is corrupted.
Have you tried opening the file in binary mode?
#include <fstream>
std::fstream f("myfile.bin",
ios_base::binary | ios_base::in | ios_base::out);
HTH,
--Eljay