In this post i am posting a simple c program to copy the data from one file to another file .
#include<stdio.h>
void main()
{
FILE *f1, *f2;
char ch;
clrscr();
f1 = fopen("priya.txt","r");
f2 = fopen("jagan.txt", "w");
while((ch=getc(f1))!=EOF)
putc(ch, f2);
printf("\n\tData has been copied");
fclose(f1);
fclose(f2);
getch();
}
0 comments:
Post a Comment