Search code examples
c++consolewindows-console

Console output - way to let caret jump to columns and rows


Is it possible to output such a escape code so that the caret in console moves to proper absolute location? I've seen something similar on unix console. Is this even possible on the basic and simple Windows console? Thanks


Solution

  • Don't use an escape code, use SetConsoleCursorPosition

    COORD C = { 3, 3 };
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), C);