Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 c 语言文件,其中包含我想在此文件中添加另一个文本而不删除最后一个文本仅在文件末尾添加新文本的文本
a只需以附加模式打开文件,因为标准说
a
以附加模式(“a”作为模式参数中的第一个字符)打开文件会导致所有后续对该文件的写入都被强制到当时的当前文件结尾,而不管对 fseek 函数的干预调用。