What is the easiest way to display changing numbers in the console? I have a normal command line program in C++ which uses cout, but I\'d like to display a percenta
cout
When I’ve needed that I have just output a carriage return character, in C++ \r.
\r
Remember to flush the output each time, e.g.
cout << "\r" << x << "% completed. " << flush;
The spaces at the end to clear previous output on the line in case of Microsoft-like fluctuating progress.