title: Flushing buffer with fgets
body: <p>I used to use <code>fflush(stdin)</code>. I read that this is not a good way to get rid of the extra characters and that it is better to use fgets like this:</p>
  
  <pre><code>fgets(buffer,maxsize,stdin);
  </code></pre>
  
  <p>In cases that I want to dispose of those extra chars...what kind of buffer should I use? Could I redirect in some kind of "buffer of no return"? Or do I have to use a finite size array?</p>
  
  <p>Thanks in advance.</p>