title: how to empty stardard input/output buffer in C
body: <p>First i call getchar() and enter some character on standard input/output , because scanf() can also fetch these characters , i want to empty the buffer , before calling scanf() , here is the program.</p>
  
  <pre><code>int main()
    {
      getchar();   // i input some characters here , "abcdefgh" 
  
  
      ------ // here i need some statement that will empty standard input/output.
  
      int a;
      scanf("%d",&amp;a);  // so if buffer is empty, this prompt me to enter chacter.
                                      // if i enter 7 
      printf("%d",a);                // this should print 7
  
      }
  </code></pre>