title: scanf() leaves the newline character in the buffer
body: <p>I have the following program:</p>
  <pre><code>int main(int argc, char *argv[])
  {
      int a, b;
      char c1, c2;
      printf(&quot;Enter something: &quot;);
      scanf(&quot;%d&quot;, &amp;a); // line 1
      printf(&quot;Enter other something: &quot;);
      scanf(&quot;%d&quot;, &amp;b); // line 2
  
      printf(&quot;Enter a char: &quot;);
      scanf(&quot;%c&quot;, &amp;c1); // line 3
      printf(&quot;Enter another char: &quot;);
      scanf(&quot;%c&quot;, &amp;c2); // line 4
  
      printf(&quot;Done&quot;); // line 5
  
      system(&quot;PAUSE&quot;);
  
      return 0;
  }
  </code></pre>
  <p>As I read in the C book, the author says that <code>scanf()</code> left a newline character in the buffer, therefore, the program does not stop at line 4 for user to enter the data, rather it stores the new line character in <code>c2</code> and moves to line 5.</p>
  <p>Is that right?</p>
  <p>However, does this only happen with <code>char</code> data types? Because I did not see this problem with <code>int</code> data types as in line 1, 2, 3. Is it right?</p>