ios::out
opens the file for writing.
ios::binary
makes sure the data is read or written without translating new line characters to and from \r\n
on the fly. In other words, exactly what you give the stream is exactly what’s written.
More Related Contents:
- c++ open file in one line
- Assigning char array from ifstream breaks array if adding another char to array
- Reading from text file until EOF repeats last line [duplicate]
- How to construct a c++ fstream from a POSIX file descriptor?
- mmap() vs. reading blocks
- Getting a FILE* from a std::fstream
- How to read a file line by line or a whole text file at once?
- In C++ is there a way to go to a specific line in a text file?
- std::fstream doesn’t create file
- Using C++ filestreams (fstream), how can you determine the size of a file?
- How to read a growing text file in C++?
- C++ Filehandling: Difference between ios::app and ios::ate?
- Retrieving file descriptor from a std::fstream [duplicate]
- do I need to close a std::fstream? [duplicate]
- How to write to middle of a file in C++?
- Why is failbit set when eof is found on read?
- Reading and writing to the same file using the same fstream
- std::fstream buffering vs manual buffering (why 10x gain with manual buffering)?
- fstream won’t create a file [duplicate]
- How to truncate a file while it is open with fstream
- Reading line from text file and putting the strings into a vector?
- How can I use non-default delimiters when reading a text file with std::fstream?
- How to count lines of a file in C++?
- std::ofstream, check if file exists before writing
- CLion C++ can’t read/open .txt file in project directory
- Why can’t I move std::ofstream?
- are “seekp” & “seekg” interchangeable?
- why iam unable to concatenate the string here?
- Correct way of declaring pointer variables in C/C++ [closed]
- Random number generator that produces a power-law distribution?