ofstream::close

voidclose();

Remarks

Calls the close member function for the associated filebuf object. This function, in turn, flushes any waiting output, closes the file, and disconnects the file from the filebuf object. The filebuf object is not destroyed.

The stream’s error state is cleared unless the call to filebuf::close fails.

ofstream OverviewOutput Stream Classes

See Also   filebuf::close, ofstream::open, ofstream::is_open