#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
FILE *from;
FILE *to;
int CopyChar;
if(argc>=4) {
printf("Too few arguments.");
exit(1);
}
if((from = fopen(argv[1], "r"))==NULL) {
printf("File %s not found.", argv[1]);
}
else
{
to = fopen(argv[2], "wb");
printf("Copying data from %s to %s...\nDone!", argv[1], argv[2]);
while((CopyChar = fgetc(from))!=EOF) {
fputc(CopyChar, to);
}
fclose(from);
fclose(to);
}
getch();
return 0;
}