#include
#include
void main()
{
clrscr();
char s,str1[50],str2[50];
printf("Enter a file name:");
gets(str1);
printf("Enter out put file:");
gets(str2);
FILE *fp,*fo;
fp=freopen(str1,"r",stdin);
fo=freopen(str2,"w",stdout);
while((s=getc(fp))!=EOF)
{
putc(s,fo);
}
fclose(fp);
fclose(fo);
// printf(" fghgd");
//if((fopen(str2,"r"))==0)
// printf("File is copied succsesfully: ");
// else
// printf("File is not copied succsesfully: "); */
// getch();
}
0 comments:
Post a Comment