this coding is about copy one existing file into other file
but it can't do so throught the command line arg. what is
the solution....?
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main(char *argv[])
{
FILE *fp1,*fp2;
char c;
int i;
clrscr();
fp1=fopen(argv[1],"r");
rewind(fp1);
fp2=fopen(argv[2],"w");
if(fp1==NULL)
{
printf("Source File is Not Exist");
exit(0);
}
while((c=getc(fp1))!=EOF)
{
putc(c,fp2);
printf("%c",c);
}
fclose(fp1);
fclose(fp2);
getch();
}