I am trying to update some code and change a fopen() file operation with std:ofstream.During an fopen file operation fputs() is used to write contents into a fail.Checking the return of fputs ::(fputs() return a nonnegative number on success, or EOF on error
). I need to check the copy of contents into the file.
This example is taken from : cplusplus.com
// ofstream::open / ofstream::close
#include <fstream> // std::ofstream
int main () {
std::ofstream ofs;
ofs.open ("test.txt", std::ofstream::out | std::ofstream::app);
ofs << " more lorem ipsum";
ofs.close();
return 0;
}
I am trying to find a way to check ofs << " more lorem ipsum";
operation.Is there any kind of return of this operation?Does this throws something?
Warmest Regards.