What is a replacement for system("cls")?
I want to clear the screen and start at back at the top of it.
p.s I'm afraid someone on this forum would stab me if i did use system("cls")
//i guess my code would go something like this...
#include <iostream>
using namespace std;
int main()
{
cout << "bla bla bla...";
system("cls"); // Oh no
cout << "This is printed at the top of the console. Yay.";
}
well depends how many lines you want to clear. Technically if it is only one line at a time you can use '\r'
otherwise you will have to move the cursor and then use '\r' on each line
There could be other more efficient ways though.