title: How does fgetc() know the next character's address? How to retrieve the current character address?
body: <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      FILE *fp;
      char ch;
  
      fp=fopen("file1.txt","r");
  
      while(feof(fp))
      {
          ch=fgetc(fp);
          printf("%c",ch);
      }
  
      return 0;
  }
  </code></pre>
  
  <p>How does <code>fgetc()</code> know which character to <s>print</s> read (because <code>fp</code> remains same throughout the program, not incremented); same for how does it identify <code>EOF</code>? I mean, what does it actually refer to get to know where exactly it is now?
  How can I retrieve that memory address and print it?</p>