Jan
23
#include<stdio.h>
#include<conio.h>
void main(){
char ch;char fname[100],tname[100];
FILE *fp,*tp;
int i;
printf(“\n Enter File name want to copy: “);
gets(fname);
printf(“\n Enter File name where want to copy: “);
gets(tname);
fp=fopen(fname,”r”);
tp=fopen(tname,”w+”);
printf(“\n Copy in process…\n\n”);
while(!feof(fp)){
ch=getc(fp);
putc(ch,tp);
}
printf(“\nCopied Successfull\n”);
rewind(tp);
while(!feof(tp)){
ch=getc(tp);
printf(“%c”,ch);
}
fclose(fp);
fclose(tp);
}
Leave a Reply
No Comments