title: Double buffering in the console (display)?
body: <p>I'm trying to create a console pong game but have run into the following issue.
  I have the following:</p>
  
  <pre><code>int main()
  {
      while(1)
      {
          clearScreen();
  
          std::stringstream sstr;
          for(int i = 0; i &lt; 20; ++i)
          {
              sstr &lt;&lt; "Mooooooo \n";
          }
          printf(sstr.str().c_str());
          restThread(50);
      }
      return 0;
  }
  </code></pre>
  
  <p>The output I would expect is for Moo to be written 20 times and for the contents of the screen to never actually change. However it flickers from time to time. I suspect this is because the output is shown to the screen before it is fully drawn. Is there a way around this? eg, not showing the user anything until all the characters have been drawn to the screen?</p>
  
  <p>Thanks</p>