您的位置:首页 > 其它

第十六周--阅读程序

2016-06-23 09:18 211 查看
问题及代码:
/*计算机与控制工程学院
完成日期:2016/6/23
作者:马艳艳
文件描述:阅读程序
*/
#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;
}


运行结果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: