View Single Post
Team Leader
20Mar2007,13:45  
pradeep's Avatar
To make sure that there is no CR/LF translation on non-Unix computers, you have to use the following lines to open streams to files with binary data.

Code: CPP
ofstream os("output.flt", ios::out | ios::binary);
 ifstream is("output.flt", ios::in | ios::binary);

For Visual C++, when using fstream.h, use in addition the flag ios::nocreate. Otherwise you can open a non-existing file for reading, without complaining. (This is not necessary when using fstream).