“a+” Open a file for reading and appending. All writing operations are performed at the end of the file, protecting the previous content to be overwritten. You can reposition (fseek, rewind) the internal pointer to anywhere in the file for reading, but writing operations will move it back to the end of file. The file is created if it does not exist.
在C/C++中,用a/a+打开文件,fseek只能改变读取的位置,写操作全部都会添加到文件末尾。