Reputation: 33
I was trying to print a transaction for my project, but I wanted to set the cursor back to the first line so as to be able to make it work better. I don't want to use system("cls")
because it deletes all the page, and then the transaction will not look cool.
I tried cout<<string(200,'\b');
and cout<<string(200,'\r');
Upvotes: 0
Views: 113
Reputation: 33
I could use the SetConsoleCursorPosition()
function in the windows.h
header, like this:
COORD coor;
coor.X = 0;//where x should be
coor.Y = 0;//where y should be
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coor);//where it should set the cursor back
Upvotes: 1