#include<stdio.h>
#include<stdlib.h>
void OpenFile(char filename[],char fcopyname[])
{
char ch;
char a[100];
FILE *p,*q;
p = fopen(filename,"w");
printf("input a string:/n");
scanf("%s",a);
q = fopen(fcopyname,"wt");
if(!q)
printf("error");
while((ch = fgetc(p))!=EOF)
{
fputc(ch,q);
}
fclose(p);
fclose(q);
}
void main()
{
char filename[10];
char fcopyname[10];
printf("input a filename:/n");
scanf("%s",filename);
printf("input a fcopyname/n");
scanf("%s",fcopyname);
OpenFile(filename,fcopyname);
}
文件读写
最新推荐文章于 2023-11-13 16:04:28 发布