Given the following code:
std::ofstream stream(\"somefile\");
if (!stream)
{
return 1;
}
When invoking .write(....) and using
The default mode used by the stream constructor is ios_base::out
. As there is no explicit text
mode flag, this implies the stream is opened in text mode. Text mode only has an effect on Windows systems, where it converts \n
characters to CR/LF pairs. On POSIX systems it has no effect, and text and binary modes are synonymous on these systems.