ofstream outfile;
outfile.open(“filename”,ofstream::out|ofstream::trunc);
C++文件操作
本文介绍了一个使用C++进行文件操作的例子,通过ofstream类实现文件的打开与写入,并使用trunc模式来覆盖原有内容。
ofstream outfile;
outfile.open(“filename”,ofstream::out|ofstream::trunc);
3420
3735
804
1929

被折叠的 条评论
为什么被折叠?