Re: \n to \r\n in stdout

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

 



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


[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