13.2

来源:互联网 发布:圆形水池计算软件 编辑:程序博客网 时间:2024/05/17 16:02
#include<stdio.h>
#include<stdlib.h>
int main()
{
FILE *in,*out;
char ch,infile[10],outfile[10];
printf("Enter the infile name :\n");
scanf("%s",infile);
printf("Enter the output name :\n");
scanf("%s",outfile);
if((in=fopen(infile,"r"))==NULL)
{
printf("cannot open infile \n");
exit(0);
}
if((out=fopen(outfile,"w"))==NULL)
    {
printf("cannot open outfile \n");
exit(0);
}
    while(!feof(in))
fputc(fgetc(in),out);
fclose(in);
fclose(out);




return 0;
}