title: Does ncurses getch() with echo() on ensure that the character will be visible on the screen before the next statement in the program is executed?
body: <p>I have an ncurses program that looks like this </p>
  
  <pre><code>1. int c =0;
  2. initscr();
  3. timeout(-1);
  4. printw("Enter a character");
  5. getch();
  6. printw("\nOkay\n");
  7. c = 5;
  </code></pre>
  
  <p>I would expect that the output of <code>getch()</code> as well as following <code>printw()</code> should happen (and be visible on the screen) before c is modified to 5. However this does not seem to be happening ( Using qemu-kvm and breaking at that point to verify). Is there any reason why this might be happening or some way to ensure the output being visible on the screen before the next statement is executed ?
  does fflush(stdout) guarantee that ?</p>
  
  <p>The OS is virtualized gentoo being run using qemu-kvm. The screen is in console mode ( X not initialized).</p>