View Single Post
Old 05 October 2012, 11:25   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
I think what you're seeing is the automatic line ending conversion. Windows tries to be different and incompatible with everything else, and uses carriage return + line feed for line endings (byte sequence 13 and 10).

If you open your files in binary mode it should work:
Code:
// ios::in and ios::out are implied with ifstream and ofstream

ifstream inputFile(inFile, ios::binary);
ofstream outputFile(outFile, ios::binary);
and if you ever do C-style I/O then you would add "b" to the file mode:
Code:
FILE* f = fopen("i.bin", "rb");
FILE* f = fopen("o.bin", "wb");
Leffmann is offline  
 
Page generated in 0.05206 seconds with 11 queries