I have a std::string object containing binary data that I need to write to a file. Can ofstream f("name"); f << s; ofstream f("name"); f << s; be problematic? I need to read the data back exactly as it was originally.
I can of course use fwrite(s.c_str(), s.size(), 1, filep) , are there any pros / cons for any method?
davka
source share