Is this method of checking, if flush() succeeded or failed, valid?
Code:
std::ofstream ofs;
file.open("test.txt")
file << "line of text";
if (!ofs.flush()) {
std::cout << " failed to write \n ";
return 1;
}
Comment