/* 范例9-23 */#include stdio.h#include stdlib.hvoid main(int argc,char *argv[]){FILE *fp1;int pos;if((fp1fopen(argv[1],w))NULL){printf(File Open Error!\n);exit(1);}fputs(abcdefg,fp1);fputs(\n0123456,fp1);fclose(fp1);/* 可擦写(更新) */if((fp1fopen(argv[1],r))NULL){printf(文件打开错误\n);exit(1);}pos fseek(fp1,4,0); /* 从文件头跳4bytes */putc(65,fp1);printf(pos %d\n,pos);fseek(fp1,6,2); /* 从文件尾跳6bytes */putc(#,fp1);fseek(fp1,3,1); /* 从目前位置跳3bytes */putc(,fp1);fclose(fp1);}程序执行结果(假设输出文件名out)D:\TCp9-23 outpos 0D:\TCtype out 检查文件out内容abcdAfg0123456 #