源程序:

#include <stdio.h>
#include <stdlib.h>
void filecopy(FILE *,FILE *);
int main()
{
FILE *fpin,*fpout;
fpin=fopen("e:\\file_a.txt","r");
fpout=fopen("e:\\file_b.txt","w");
filecopy(fpin,fpout);
fclose(fpin);
fclose(fpout);
return 1;
}

void filecopy(FILE *fpin,FILE *fpout)
{
char ch;
ch=getc(fpin);
while(!feof(fpin))
{
putc(ch,fpout);
ch=getc(fpin);
}
}

 运行结果:

编写程序,用于把一个文本文件(源文件)复制到另一个文件(目标文件)中。 源文件名为file_a.txt, 目标文件名为file_b.txt

相关文章:

  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-05
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
  • 2021-07-04
相关资源
相似解决方案