94. Program to copy contents of one file into another.
Code:
#include<conio.h>
#include<stdio.h>
main( )
{
FILE * fp1,*fp2;
char ch;
fp1=fopen(“text1”,”w”);
printf(“enter the text”);
while((ch=getchar()!=EOF);
putc(ch,fp1);
fclose(fp1);
fp1=fopen(“text1”,”r”);
fp2=fopen(“text2”,”w”);
while((ch=getc(fp1))!=EOF)
putc(ch,fp2);
fcolse(fp1);
fcolse(fp2);
getch( );
}
All materials on the site are licensed Creative Commons Attribution-Sharealike 3.0 Unported CC BY-SA 3.0 & GNU Free Documentation License (GFDL)
If you are the copyright holder of any material contained on our site and intend to remove it, please contact our site administrator for approval.
© 2016-2025 All site design rights belong to S.Y.A.