Well, here are two functions which I think will come in handy -
Code:
// Sets the position of the text-cursor, starts at 0, 0 on the
// top left
void GotoXY ( int x, int y )
{
COORD Cursor_Position;
Cursor_Position.X = x;
Cursor_Position.Y = y;
SetConsoleCursorPosition( GetStdHandle ( STD_OUTPUT_HANDLE ), Cursor_Position );
}
// Gets the current position of the text-cursor
void GetXY ( int &x, int &y )
{
CONSOLE_SCREEN_BUFFER_INFO XYInfo;
GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ), &XYInfo );
x = XYInfo.dwCursorPosition.X;
y = XYInfo.dwCursorPosition.Y;
}