/*****************************************************
copyright (C), 2014-2015, Lighting Studio. Co., Ltd.
File name:
Author:Jerey_Jobs Version:0.1 Date:
Description:
Funcion List:
*****************************************************/
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
FILE *from_file,*to_file;
char ch;
if((from_file = fopen("a.txt","r+")) == NULL)
{
printf("from_file open fali!\n");
exit(1);
}
if((to_file = fopen("b.txt","w+")) == NULL)
{
printf("to_file open fali!\n");
exit(1);
}
while(fgetc(ch,from_file) != EOF)
{
fputc(ch,to_file);
}
fclose(from_file);
fclose(to_file);
printf("\n");
return 0;
}
库函数fopen/fgetc/fputc实现两个文件内容的复制
最新推荐文章于 2024-08-13 17:28:12 发布