title: How to flush the console buffer?
body: <p>i have some code that run repetedly :</p>
  
  <blockquote>
    <p>printf("do you want to continue? Y/N: \n");<br>
    keepplaying = getchar();</p>
  </blockquote>
  
  <p>in the next my code is running it doesnt wait for input.
  i found out that getchar in the seconed time use '\n' as the charcter.
  im gussing this is due to some buffer the sdio has, so it save the last input which was "Y\n" or "N\n".</p>
  
  <p>my Q is, how do i flush the buffer before using the getchar, which will make getchar wait for my answer?</p>