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.
次の問題があります。
私のプログラムはファイルを開き、そのすべてのコンテンツをベクターにコピーします。その後、ファイルの先頭に戻って、別の順序で内容を書き直す必要があります。
と を使用してみclearましseekpたが、うまくいきませんでした。誰でも私を助けてもらえますか?
clear
seekp
これはコードです:
first_index私が作業しているファイルです:
first_index
first_index.clear(); first_index.seekp (0, ios_base::beg);