http://msdn. character string mode specifies the kind of access that is requested for the file, as follows.
"r"
Opens for reading. If the file does not exist or cannot be found, the fopen call fails.
"w"
Opens an empty file for writing. If the given file exists, its contents are destroyed.
"a"
Opens for writing at the end of the file (appending) without removing the end-of-file (EOF) marker before new data is written to the file. Creates the file if it does not exist.
"r+"
Opens for both reading and writing. The file must exist.
"w+"
Opens an empty file for both reading and writing. If the file exists, its contents are destroyed.
"a+"
Opens for reading and appending. The appending operation includes the removal of the EOF marker before new data is written to the file. The EOF marker is not restored after writing is complete. Creates the file if it does not exist.
得到文件末尾指针 不是说空指针