title: How to update a printed message in terminal without reprinting
body: <p>I want to make a progress bar for my terminal application that would work something like:</p>
  
  <pre><code> [XXXXXXX       ] 
  </code></pre>
  
  <p>which would give a visual indication of how much time there is left before the process completes. </p>
  
  <p>I know I can do something like printing more and more X's by adding them to the string and then simply printf, but that would look like:</p>
  
  <pre><code> [XXXXXXX       ] 
   [XXXXXXXX      ] 
   [XXXXXXXXX     ] 
   [XXXXXXXXXX    ] 
  </code></pre>
  
  <p>or something like that (obviously you can play with the spacing.) But this is not visually aesthetic. Is there a way to update the printed text in a terminal with new text without reprinting? This is all under linux, c++.</p>