MSDN:
"r"
Opens for reading. If the file does not exist or cannot be found, the fopen call fails.
以读的方式打开文件,如果文件不存在fopen打开文件失败。
"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 EOF marker before writing new data to the file; creates the file first if it doesn't exist.
以追加方式打开文件。如果文件不存在创建文件。
"r+"
Opens for both reading and writing. (The file must exist.)
追加方式写入文件,如果文件不存在,打开文件报错。
"w+"
Opens an empty file for both reading and writing. If the given 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 and the EOF marker is restored after writing is complete; creates the file first if it doesn't exist.