text:
For example, open "myfile.txt"
1. Traditional used in C
File * fp;
Char * fn = "myfile.txt";
FP = fopen (FN, "A ");
IF (fp! = null)
{
// USE File
}
Fclose (fp);
2, recommended in C
Ofstream of;
OF. OPEN ("MyFile.txt")
Of.close ()
This personal feeling is better than fopen, and the general use does not have to pay attention to so many parameters.
3. The createfile function used in WIN32.
On Windows, I feel that the use of the CreateFile series is more authentic, you have to take a closer look.
MSDN, each time you write a data block to the file, which is very common.
4, use CFILE in MFC
This is rarely used. Unclear, it may be convenient.