title: fgetc(stdin) in a loop is producing strange behaviour
body: <p>I have this code</p>
  
  <pre><code>while(1){
      printf("hello world !\n");
      fgetc(stdin);
  }
  </code></pre>
  
  <p>when this runs and I enter a letter like this:</p>
  
  <pre><code>hello world !
  a
  </code></pre>
  
  <p>it ignores the fgetc(stdin) in the next loop and prints hello world twice without waiting for input.</p>
  
  <pre><code>hello world !
  a
  hello world !
  hello world !
  a
  hello world !
  hello world !
  a
  hello world !
  hello world !
  a
  hello world !
  hello world !
  </code></pre>
  
  <p>I have tried putting fflush(stdin) before or after the fgetc(stdin) but it still produces the same behaviour, what am I doing wrong ?</p>