My question concerns deleting already written chars in the console. Is there a way to do it? Lets say i write 10 spaces to the console. Can i delete some to make space for other chars without the output exeeding 10 chars? I use a special libary given, with functions for writing in the console etc.
Use '\b'. It erases one character, and the cursor moves back:
std::cout << "nawaz"; //screen shows : nawaz
std::cout << '\b'; //'z' is erased, now screen shows : nawa
do {
cout<<"\b"<<num--;
}
while ( num >0 );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With