FILE *fs,*ft;
char ch;
char strSource[_MAX_PATH];
char strDestination[_MAX_PATH];
printf("\n Enter the source file path : ");
scanf("%s",&strSource);
fs = fopen(strSource,"r");
if(fs==NULL)
{
printf("\n Cannot open source file !");
return 1;
}
printf("\n Enter the source file path : ");
scanf("%s",&strDestination);
ft = fopen(strDestination,"w");
if(ft==NULL)
{
printf("\n Cannot copy file ! ");
fclose(fs);
return 1;
}
while(true)
{
ch = getc(fs);
if(ch==EOF)
break;
else
putc(ch,ft);
}
printf("\n File copied succesfully!");
fclose(fs);
fclose(ft);
return 0;