第十五周阅读项目3.(2)

来源:互联网 发布:台湾死刑 知乎 编辑:程序博客网 时间:2024/06/05 09:03

问题及代码:

#include <fstream>using namespace std;int main (){    long pos;    ofstream outfile;    outfile.open ("test.txt");    outfile.write ("This is an apple",16);    pos=outfile.tellp();    outfile.seekp (pos-7);    outfile.write (" sam",4);    outfile.close();    return 0;}


运行结果:

 

0 0
原创粉丝点击