#include<stdio.h>
#include<conio.h>
void main()
{char ch;
FILE *fp=fopen("c:\\tc\\data_file.txt","r");
clrscr();
if(fp==NULL)
{
printf("\n\n File does not exist \n");
getch();
exit(0);
}
while(1)
{ch=fgetc(fp);
if(ch==EOF)
break;
putc(ch,stdout);
}
fclose(fp);
getch();
}
Comments
Post a Comment