文件阅读(8)

*Copyright (c) 2014,烟台大学计算机学院

*All right reserved.

*文件名称:test.cpp

*作    者:韩双志

*完成日期:2016年6月23日

*版本号:v1.0

*
*问题描述;文件操作

*输入描述:无

*输出描述:输出相关内容

/*

#include
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;
}

*/

运行结果:

文件阅读(8)_第1张图片

 

你可能感兴趣的:(文件阅读(8))