title: Confusion with == EOF vs feof
body: <p>I opened a file, the stream is found at the address of pointer <code>ptr</code>. I am attempting to see whether or not a file is blank. Using the following</p>
  
  <pre><code>if (fgetc(ptr) != EOF)
  </code></pre>
  
  <p>works as expected. When the file is blank, the statement is not executed. When the file is not blank, the statement is not executed.</p>
  
  <p>However, using</p>
  
  <pre><code>if (!feof(ptr))
  </code></pre>
  
  <p>always executes the statement.</p>
  
  <p>Why does this happen? Is there a way to use the <code>feof</code> function?</p>