how can i write to file with out carriage return

hi all ..
i'm trying to write to file ok
then i used a streamwrtier then try to write to file some characters .. and they were written successfully
but when i tried to read them as byte i faced a character byte with value 13 .. i didn't write it
as eg. i white in my code

strmwrtr->writeline("P2");

i found
80 = P then
50 = 2 then
13 -----> my problem
i searched the net how can i avoid this .. but .. nothing
Open the output file as binary instead of text. Using std::ofstream::write() may also work regardless of how the file was opened.
i read byte by byte with streamreader .. as i'm working on a .net application project not console one
so i can't ofstream ...
This is a C++ forum.
Topic archived. No new replies allowed.