/*
* Copyright(c)2016,烟台大学计算机与控制工程学院
* All rights reserved.
* 文件名称:第16周阅读程序4(2)
* 作者:马康泰
* 完成日期:2016.6.15
* 版本号:v1.0
*
* 问题描述:阅读下面的程序,指出其功能,体会seekg()、tellg()等函数的功能及其用法
* 输入描述:
* 程序输出:
*/
#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;
}
}
第16周阅读程序4(2)
最新推荐文章于 2019-04-10 22:31:52 发布