2.2.5.1.1 file::Close

Description

Close the file associated with the indicated file object.

Syntax

BOOL Close( )

Parameters

Return

A value of FALSE or 0 indicates fail to close file and a value of TRUE or a

non-zero indicates sucessfully closing file.

Examples

EX1

void file_Close_ex1()
{
    char szTemp[MAXFULLPATH] = "C:\\test.txt";
    string strFile = szTemp;
    file ff;
    if( ff.Open(szTemp, file::modeCreate | file::modeWrite) )
    {
        ff.Write(szTemp, strFile.GetLength()); // Write the file name into the file.
        ff.Close(); // Close the file when we are done.
    }
}

Remark

Closes the file associated with the indicated file object. The file is then no longer available for reading and writing.

See Also

file::Open

Header to Include

origin.h