C++ Close file

tutorial and example
tutorial and example

C++ File Handling close() Function

A file which is opened while reading or writing in file handling, must be closed after performing action on it. The close() function is used to close the file currently associated with object. The close() uses ofstream library to close file.

Syntax

Example

C++ File Handling close() Function Example

Output: