C++ Close file

C++ File Handling close() Function

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

Syntax

Example

C++ File Handling close() Function Example

Output:

C++ File Handling Close Functions

Leave a Comment