The CFile family of classes provides a C++ programming interface to operating-system files. The CFile class itself gives access to low-level binary files, and the CStdioFile class gives access to buffered “standard I/O” files. CStdioFile files are often processed in “text mode,” which means that newline characters are converted to carriage return–linefeed pairs on output.
CMemFile supports “in-memory” files. The files behave like disk files except that bytes are stored in RAM. An in-memory file is a useful means of transferring raw bytes or serialized objects between independent processes.
Because CFile is the base class for all file classes, it provides a polymorphic programming interface. If a CStdioFile file is opened, for example, its object pointer can be used by the virtual Read and Write member functions defined for the CFile class.
The CDumpContext and CArchive classes, described previously, depend on the CFile class for input and output.