Monday 27 August 2012

file using file program in c

with the help of pointer this program shows to open abc.txt
file using file program in c
#include<stdio.h>      // HEADER FILES//
#include<conio.h>
main()                  //main start//
{
FILE * fp;                                 
char ch;
clrscr();
fp=fopen("abc.txt","r");
if(fp==NULL)            //if file is null//
{
printf("error");
getch();
}
while(1)
{
ch=fgetc(fp);
if(ch==EOF)
break;
printf("%c",ch);
}
fclose(fp);
getch();
}
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: