I know it will appear ugly, but, suppose a simple program like:
int main(void)
{
int line=0, column=1;
char c;
system("clear");
printf("0123\n4567\n");
getprintedchar(column, line, &c);
printf("%c", c);
return 0;
}
That will print number 1.
How can we program such function using LINUX terminal. I know we can use ncurses, but that prevent a lot of options printf and alike allows.
I wonder if we can use struct termios or some other super-clunk hacker!
For those comming from borland/windows, it resembles a simplified version of the conio.h function gettext().
Can we read some area of memory? Maybe some assembly to get the character directly from some area of the Video RAM?
Thanks!
You can always use
snprintfto format a string, then output it any way you want. (N)curses is a good library for terminal handling.In particular, this is impossible. You can’t access the terminal’s memory since it’s a separate process and it won’t share.