This code will do what you're asking for, however, I have only tested it in windows. Its behavior may be different under linux/mac.

Qt Code:
  1. #include <iostream>
  2. using std::iostream;
  3.  
  4. int main()
  5. {
  6. for (int i=0; i < 5; i++)
  7. cout << "Progress: " << i*25 << "%\r";
  8.  
  9. return 0;
  10. }
To copy to clipboard, switch view to plain text mode