@This is a program to copy the contents of one file into another using fputc.
@
1.1
log
@Initial revision
@
text
@#include<stdio.h>
int main()
{
FILE *fp1,*fp2;
char a;
fp1=fopen(“file2″,”r”);
if(fp1==NULL)
{
puts(“cannot open this file”);
goto OUT;
}
fp2=fopen(“file1″,”w”);
if(fp1==NULL)
{
puts(“cannot open this file”);
goto OUT;
}
do
{
a=fgetc(fp1);
fputc(a,fp2);
}
while(a!=EOF);
return 0;
OUT:
return -1;
}
@