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.
我遇到以下问题:
我的程序打开一个文件并将其所有内容复制到一个向量中。之后,我需要回到文件的开头并以另一个顺序重写内容。
我尝试使用clearand seekp,但没有用。任何人都可以帮助我吗?
clear
seekp
这是代码:
first_index是我正在使用的文件:
first_index
first_index.clear(); first_index.seekp (0, ios_base::beg);