Suppose my whole screen (console) is filled with some text (e.g. printed through std::cout
). How can I get some characters of this console output, e.g. in the center of screen?
In Windows I can get characters of console through ReadConsoleOutputCharacter function.
But how to do same thing in Linux (inside C++ (or C) code)?
Is there any easy way to do this without using extra huge libraries like ncurses
? Maybe there are some standard Linux kernel sys-call functions to achieve this task?
I need to get console text of current running program. I.e. if inside my program I printed some text, later inside this same program I want to read parts of this printed to console text.