If you're programming in Windows you can use SetConsoleCursorPosition to position the cursor before a cout.