I've got the following code:
Code:
#include <stdio.h>
FILE * fptr;
int main()
{
  char fileLine[81];
  fptr = fopen("C:\\aap.txt", "r");
  if (fptr != 0)
     {
      while (!feof(fptr))
            {
             fgets(fileLine, 81, fptr);
             if (!feof(fptr))
                {puts(fileLine);}
             }
      }
   else
       {printf("\nError opening file.\n");}
   fclose(fptr);
   getchar();
   getchar();
  return 0;
}
Let's start with the first bit.

I'm not sure about
Code:
while (!feof(fptr))
            {
             fgets(fileLine, 81, fptr);
             if (!feof(fptr))
                {puts(fileLine);}
What does while (!feof(fptr)) do exactly? I can see that it checks whether the end of the file as been reached.

Would (feof(fptr)) return 1 if the end of the file had been reached and 0 if the end of the file hadn't been reached?

If so how can it do that,
Code:
 FILE * fptr;
(I thought) means, store the adress of FILE in fptr. It doesn't say much about the lengt of the file does it? (or does it store the end adress of the file too, so that it knows how long it is, as this is a special FILE-pointer?)


Thank You.