#include<stdio.h>
#include<conio.h>
void main()
{
FILE *fs,*ft;
char ch;
clrscr();
fs=fopen("a.txt","r");
if (fs==NULL)
{
printf("\n unable to open file");
}
ft=fopen("b.txt","w");
if (ft==NULL)
{
printf ("\n unable to open file");
}
while((ch=fgetc(fs))!=EOF)
{
fputc (ch,ft);
}
fclose(fs);
fclose(ft);
getch();
}
#include<conio.h>
void main()
{
FILE *fs,*ft;
char ch;
clrscr();
fs=fopen("a.txt","r");
if (fs==NULL)
{
printf("\n unable to open file");
}
ft=fopen("b.txt","w");
if (ft==NULL)
{
printf ("\n unable to open file");
}
while((ch=fgetc(fs))!=EOF)
{
fputc (ch,ft);
}
fclose(fs);
fclose(ft);
getch();
}