COPYING A FILE USING A+ AND W+ MODE


LIST OF PROGRAMS


#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
FILE *fp,*fp2;
clrscr();
fp=fopen("anujhello.txt","a+");
fp2=fopen("anujhello2.txt","w+");
printf(" ENTER THE DETAILS");
while((ch=getc(fp))!=EOF)
putc(ch,fp2);
rewind(fp2);
while((ch=getc(fp))!=EOF)
printf("%c",ch);

fclose(fp);
getch();
}

LIST OF PROGRAMS


Comments