#include<stdio.h>
#include<conio.h>
#include<process.h>
void main(int argc,char *argv[])
{
FILE *fs,*ft;
char ch;
if(argc!=3)
{
puts("insufficient argument");
exit(0);
}
fs=fopen(argv[1],"r");
if(fs==NULL)
{
printf("\ncannot open source file");
exit(0);
}
ft=fopen(argv[2],"w");
if(ft==NULL)
{
printf("cannot open source file");
fclose(fs);
exit(0);
}
while(1)
{
ch=fgetc(fs);
if(ch==EOF)
break;
else
fputc(ch,ft);
}
getch();
}
No comments:
Post a Comment