Closing Files

HomeOverviewHow Do I

As usual in I/O operations, once you finish with a file, you must close it.

To close a file

If you allocated the CFile object on the frame (as in the examples shown earlier), the object will automatically be closed and then destroyed when it goes out of scope. Note that deleting the CFile object does not delete the physical file in the file system.