#include "stdio.h"
int main(){
char infile[10],outfile[10];
FILE *fpa,*fpb;
gets(infile);
gets(outfile);
fpa=fopen(infile ,"r");
fpb=fopen(outfile,"w");
while(!feof(fpa)) fputc(fgetc(fpa),fpb);
fclose(fpa);
fclose(fpb);
}
#include "stdio.h"
int main(){
char infile[10],outfile[10];
FILE *fpa,*fpb;
gets(infile); //输入文件名a.txt 文件必须存在
gets(outfile); //输入另外一个文件名b.txt 文件必须存在
fpa=fopen(infile ,"r"); //打开文件a, 只读
fpb=fopen(outfile,"w"); //打开文件b, 编辑
while(!feof(fpa)) fputc(fgetc(fpa),fpb); //把文件a的读出来, 写入文件b.
fclose(fpa);
fclose(fpb); //结束
}
输入一个infile文件名,再输入一个outfile文件名
读取infile文件,写入outfile文件