#include <myhead.h>
int main (int argc, const char *argv[])
{
if(argc!=3)
{
printf("外部传参错误\n");
return -1;
}
FILE *fp1=fopen("./1.txt","r");
if(fp1==NULL)
{
perror("fp1");
return -1;
}
FILE *fp2=fopen("./2.txt","w");
if("fp2==NULL")
{
perror("fp2");
return -1;
}
char a[100];
while((fgets(a,sizeof(a),fp1))!=NULL)
{
fputs(a,fp2);
}
printf("复制成功\n");
fclose(fp1);
fclose(fp2);
printf("复制后./2.txt的内容\n");
fp2=fopen("./2.txt","r")
char r[100];
while((fgets(r,sizeof(r),fp2))!=NULL)
{
fputs(r,stdout);
}
fclose(fp2);
return 0;
}