title: Will file pointer move with the change of file position?
body: <p>When reading K&amp;R, I became interested in how the file position is determined. By file position, I mean where in the file the stream is currently reading or writing. I think it must have something to do with the file pointer, or the piece of data it's pointing to. So I checked stack overflow, and find the following answer:</p>
  
  <p><a href="https://stackoverflow.com/questions/10696845/does-fread-move-the-file-pointer">Does fread move the file pointer?</a></p>
  
  <p>The answer indicates that file pointer will change with the change of file position. This makes me very confused, because in my understanding, a file pointer for a certain file should always point to the same address, where information about this file is stored. So I wrote a small piece of code, trying to find the answer:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main(void)
  {
      char s[1000];
      FILE *fp,*fp1,*fp2;
      fp = fopen("input","r");
      fp1 = fp; /* File poiter before fread */
      fread(s,sizeof(char),100,fp);
      fp2 = fp; /* File pointer after fread */
      printf("%d\n",(fp1 == fp2) ? 1 : -1);
  }
  </code></pre>
  
  <p>It gives the output 1, which I believe indicates that the file pointer actually doesn't move and is still pointing to the same address. I have also changed the fread line to be a fseek, which gave the same output. So does file pointer move with the change of file position, or where am I wrong in the verifying process?</p>
  
  <p>Thanks!</p>