title: C/C++ printf() before scanf() issue
body: <p>I'm using Eclipse to code in C/C++ and I'm struggling with what might be something pretty easy. In my code below I use <code>printf()</code> and after <code>scanf()</code>. Althougth <code>printf</code> is written before <code>scanf()</code> the output differs. I was able to find out something about similar issue <a href="http://code.google.com/p/mintty/issues/detail?id=218" rel="noreferrer">here</a>. But I wasn't able to solve it. Any ideas?</p>
  
  <p>Code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      int myvariable;
  
      printf("Enter a number:");
      scanf("%d", &amp;myvariable);
      printf("%d", myvariable);
  
      return 0;
  }
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>Enter a number:1
  1
  </code></pre>
  
  <p>Instead I get:</p>
  
  <pre><code>1
  Enter a number:1
  </code></pre>