keep track of it in a 2-d x/y mapping is the easiest way.
as you surely know by now, c++ console support is rather limited and additional libraries with whatever capability are needed to really make cool stuff. Are you suing something like ncurses etc?
I've searched the Microsoft Virtual Terminal Sequence (VT100) documentation and do not see a sequence to read back a character (or characters) from the screen.
ESC [6r
will read back the cursor position.
ESC [0c
Will read device attributes.
But that's the extent of anything I see that will read anything from the console window in VT100 mode.
I don't think you can.
You can still track a 2-d buffer that represents the screen and what is there, keeping it in sync. Then you can read that if you need to read.
Re VT100. OK. It's a while since I used these... In that case use the Windows console functions from which you can read from the output buffer (ReadConsoleOutputCharacter())
The Windows console is based upon a resizeable 2-d buffer and a window display onto that buffer. If the buffer is larger than the window, then the shown window can be moved over the buffer to display the required part. The buffer can certainly be used as a '2-d array' to read/write from. You don't need a separate array to represent the console buffer.