1
可能重複:
In C++, what is the proper way to insert a line at the beginning of a text file?如何在C++文件的開頭添加一行?
如何在C++中的文件的開頭添加一條線嗎?
可能重複:
In C++, what is the proper way to insert a line at the beginning of a text file?如何在C++文件的開頭添加一行?
如何在C++中的文件的開頭添加一條線嗎?
使用fseek函數將光標移動到文件開始位置,並在文件的開頭添加內容。
請參閱此鏈接FSEEK
這將覆蓋文件開頭的現有數據。 – Potatoswatter 2011-04-11 05:45:40