Code:
The SetConsoleCursorPosition function sets the cursor position in the specified console screen buffer.
BOOL SetConsoleCursorPosition(
HANDLE hConsoleOutput, // handle of console screen buffer
COORD dwCursorPosition // new cursor position coordinates
);
Parameters
hConsoleOutput
Identifies a console screen buffer. The handle must have GENERIC_WRITE access.
dwCursorPosition
Specifies a COORD structure containing the new cursor position. The coordinates are the column and row of a screen buffer character cell. The coordinates must be within the boundaries of the screen buffer.