title: How do I check for nothing in the input buffer/stream in C?
body: <p>I have searched for many solutions on this but none have met my needs.</p>
  
  <p>I need to:</p>
  
  <ol>
  <li>Read two integers separated by spaces using <code>scanf()</code>.</li>
  <li>If there is only one integer entered, I need to check for that and clear the buffer.</li>
  <li>If there are more than 2 integers entered, I need to check for that and clear the buffer.</li>
  </ol>
  
  <p>So far I have been using <code>getchar()</code> to achieve the checking and clearing. The problem is that if there is nothing in the buffer, <code>getchar()</code> waits for a character.</p>
  
  <p><strong>How do I check to see if there is nothing in the input buffer/stream?</strong> This way if there is nothing, I don't have to clear the buffer with <code>getchar()</code>.</p>