title: Simple animation causes flickering screen in c++
body: <p>I am trying to use the following code to simulate a simple text-loading animation:</p>
  
  <pre><code>for (int i = 0; i &lt; 15; i ++)
  {
      system("cls");
  
      cout&lt;&lt;disp;
      disp += ".";
      Sleep(100);
  }
  system("cls");
  </code></pre>
  
  <p>However, the screen keeps blinking when I'm doing this. Is there a better way I can do this?</p>
  
  <p>Thanks.</p>