#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
clrscr();
char c[1000];
FILE *fp;
if((fp=fopen("abc.txt", "r"))==NULL)
{
printf("Not able to open file");
getch();
exit(1);
}
fscanf(fp, "%s", c);
printf("File data : %s",c);
fclose(fp);
getch();
}
No comments: