title: fgetc is always returning value 1
body: <p>there is the following function:</p>
  
  <pre><code>void readAndPrint(FILE * f) {
      int c;
  
      while(c = fgetc(f) != EOF) {
          printf("%d", c);
      }
  }
  </code></pre>
  
  <p>In the main() body I used the following code to use the above function:</p>
  
  <pre><code>FILE * pFile;
  
  pFile=fopen ("myfile.txt","r");
  
  readAndPrint(pFile)
  </code></pre>
  
  <p>;</p>
  
  <p>Whatever I put into myfile.txt, the program prints out ones. 
  For example, for abc, 111 is printed out.</p>
  
  <p>I know that c in the function should be declared int to properly compare it to EOF. Also, I expected an int code from the ASCII set for each char in the text file to be printed out (97 for a, ...). I cannot figure out why it prints out 'ones'... Does you know the reason why? Thank you in advance.</p>