is_open() == false
returns a null pointer.
If a put area exists, calls
to flush characters.
If the last virtual member function called on
(possibly several times) to determine a termination sequence, inserts those
characters and calls
Finally, regardless of whether any of the preceding calls fails or throws an
exception, the function closes the file
(as if by calling
If any of the calls made by the function, including fclose
fails by returning a null pointer.
If one of these calls throws an
exception, the exception is caught and rethrown after closing the file.