title: fflush\flushall()\_flushall() and etc won't clear buffer in C
body: <p>In all the programs I'm required to do for a project I encounter an input buffer problem, so far I cleaned it with a while loop but I've been told now not to do so (You can see it commented out).</p>
  
  <p>I tried using flushall(), _flushall() and all the alternatives that Visual Studio offers me but none of them cut it.</p>
  
  <p>What am I doing wrong? </p>
  
  <pre><code>    while (speed &lt;= 0 || distance &lt;= 0 || (distance == -1 || speed == -1))
      {
  
          scanf(" %d %d", &amp;distance, &amp;speed);
          //while (getchar() != '\n');
  
  
     }
  </code></pre>