#include <stdio.h>
#include <stdlib.h>
int fun(char *source, char *target)//声明了source和target函数
{FILE *fs,*ft; char ch;//FILE这个结构包含了文件操作的基本属性,对文件的操作都要通过这个结构的指针来进行
/**********found**********/
if((fs=fopen(source, "r"))==NULL)//将指定源文件中的内容复制到指定的目标文件中,源文件只需读,因此以只读方式打开
return 0;
if((ft=fopen(target, "w"))==NULL)//将指定源文件中的内容复制到指定的目标文件中,源文件只需写,因此以只写方式打开
return 0;
printf("\nThe data in file :\n");
ch=fgetc(fs);//从流中读fs字符
/**********found**********/
while(!feof(fs))//循环的目的是不断读取源文件直至到达源文件的末尾,循环结束标志是已达到文件的末尾.(feof()函数
05-11
2018

07-18
1万+
