HI ,
I am trying to open a txt file in C and i am successfull in doing the same , but the problem is that the contents of the file is displayed only the first time i execute the file
the rest of the time
a blank screen is getting displayed .
the problem being once when the file is executed the variable ch reaches the value EOF
how shd i point to the begining of file
pls find below the code
pls helpCode:clrscr(); fp2=fopen("c:\\rules.txt","rb"); while(1) if (ch==EOF) break; else { ch=fgetc(fp2); printf("%c",ch); } getch(); fclose(fp2);
regards
Anil



LinkBack URL
About LinkBacks



