gpt4 book ai didi

c - 文件写入C困惑

转载 作者:太空宇宙 更新时间:2023-11-04 04:09:26 24 4
gpt4 key购买 nike

您好,我在文本文件的底部追加这在 Windows 上有效,但在 Linux 上不是追加到底部,而是追加到文本文件的顶部。我正在使用的代码是。代码只能使用 C

FILE *fout;
fout = fopen("dat.txt","a");
fprintf(fout,"&& ");
fclose(fout);

请帮忙。谢谢

最佳答案

检查从这些系统调用返回的错误——代码看起来是正确的。此外,请检查以确保您没有在代码的其他地方不小心破坏 dat.txt。

关于c - 文件写入C困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1043702/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com