you can also use fstream to write to files , both text and binary , reading and writing happens the same way.


fstream mystream("myfile" ,std::ios::binary|std:ios:in); // as in reading a files...