Write a program to add the contents of one file at the end of another.
#include "stdio.h"
void main()
{
FILE *fp,*ft;
char ch,ch2;
int f=0;
fp=fopen("c:\\ctxt\\12cc1.txt","a");
ft=fopen("c:\\ctxt\\12cc2.txt","r");
fprintf(fp,"\n");
while(1)
{
ch=fgetc(ft);
if(ch==EOF)
break;
fputc(ch,fp);
}
fclose(fp);
fclose(ft);
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment