int main(int argc,const char* argv[])
{
if(argc != 3)
{
printf("Usage: %s PathName PathName\n",argv[0]);
return -1;
}
FILE *fp1 = fopen(argv[1],"r");
if(fp1 == NULL)
{
perror("fopen");
return -1;
}
FILE *fp2 = fopen(argv[2],"w");
if(fp2 != NULL)
{
fclose(fp1);
perror("fopen");
return -1;
}
char buf[128] = {0};
while(fgets(buf,sizeof(buf)-1,fp1)!=NULL)
fputs(buf,fp2);
fclose(fp1);
fclose(fp2);
return 0;
}