#include
#include
#include
int main(void)
{
int ch;
FILE *source, *destination;
errno_t err;
char source_name[41], destination_name[41];
printf("input the source file's name");
if ((err = fopen_s(&source, gets(source_name), "r")) != 0)
{
printf("can't open %s\n",source_name);
exit(1);
}
printf("input the destination file 's name");
if ((err = fopen_s(&destination, gets(destination_name), "w")) != 0)
{
printf("can't open %s\n",destination_name);
exit(1);
}
while ((ch = gets(source)) != EOF)
putc(toupper(ch),destination);
fclose(source);
fclose(destination);
printf("copy finished\n");
getchar();
return 0;
}