/* * 程序的版权和版本声明部分 * Copyright (c)2013, 烟台大学计算机学院学生 * All rightsreserved. * 文件名称:duchengxu.cpp * 作 者:赵晓晨 * 完成日期:2013年06月21日 * 版本号:v1.0 * 对任务及求解方法的描述部分:略 * 输入描述:略 * 问题描述:略 */ # 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; }
结果:
作者:dongshidexiaohai 发表于2013-6-21 11:07:08 原文链接
阅读:2 评论:0 查看评论