I am writing a program that uses a loop takes a while. I am outputing progress but currently am printing a lot of things one after another, for example:
1% 2% 3% etc...
I want to have this output in place and am trying to do so by using backspace to delete something already printed to screen and replacing it with something else. I thought I may do so using the '\b' control character but it does not seem to work. pop_back() also does not work since I am working with a double.
How can I get delete what is printed to screen?
I am using Xcode on MacBook Pro.
an example of what imagine my final code may look like is:
#include <iostream>
...
...
int main(){
for(;;){
double SomeDoubleValue = 1234;//this is value I want to display in place
/*code that deletes whatever is printed to screen here*/
cout << SomeDoubleValue << "%"; //Displaying my value as progress percentage;
}
}
Is there another way to do this other than using '\b'?