title: Reading a file one char at a time
body: <p>I have two <code>.c</code> files: one contains the main and the other contains all of my functions.</p>
  
  <p>In my main I have a part where I want to read a char at a time the loop looks like this:  </p>
  
  <pre><code>while(ch = ReadFile(fp)) != EOF)
  {
      // Code
  }
  </code></pre>
  
  <p>where <code>ch</code> is an integer (<code>int ch;</code>) and <code>fp</code> is a file pointer (<code>FILE* fp;</code>).</p>
  
  <p>And (different <code>.c</code> file ---):</p>
  
  <pre><code>int ReadFile(FILE* fp)
  {
      // Some code
      return n; // The next char
  }
  </code></pre>
  
  <p>Does anyone know how I can read one char at a time from the main this way, using this method?</p>