第十六周上机实践项目4(2):程序设计

来源:互联网 发布:如何挑选油烟机知乎 编辑:程序博客网 时间:2024/05/21 01:42
/**Copyright(c) 2016.烟台大学计算机与控制工程学院*ALL rights  reserved.*文件名称:main.cpp*作者:赵子琳*完成日期:2016年6月20日*问题描述:阅读下面的程序*/#include<iostream>#include<fstream>using namespace std;const char * filename ="a.txt";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
原创粉丝点击