gpt4 book ai didi

c++ - 在文件开头添加数据

转载 作者:太空狗 更新时间:2023-10-29 23:31:07 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Delete a Line from a file in C Language
In C++, what is the proper way to insert a line at the beginning of a text file?

如何使用c/c++编程在文件开头添加数据?我试过以下代码:

fstream file;  

stmt.open(L"d:\\xyz.txt",ios::in|ios::out|ios::app);

但这是附加在文件末尾。

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