0

Does c++ automatically flush the ofstream when it is full? For example:

std::ofstream OFile;
OFile.open("file.txt");
for (int i = 0; i < N; ++i) { 
OFile << a << " " << b << " " << c << '\n';}
OFile.close()

Here, I did not use any manipulator to flush the buffer. Is it possible that the output file is written incompeletly when the stream is full? Or will that be automatically flushed when the stream is full?

Thanks.

Eman
  • 165
  • 1
  • 1
  • 8

0 Answers0