How does the monitor store the data displayed on it? Is it stored in memory and if so how can I access it? The reason I am asking is because I am programming a text editor, in which I use an array to store the data being manipulated. I was wondering if I could access the memory containing the data displayed on the screen rather than using my own array. It seems redundant to reserve memory for the same data twice. But I just don't know how the monitor stores the data displayed on it or if it even stores it at all.
You can make very few assumptions about where
You will probably not want to use stdout for your text editor at all, but something like
Stdout is the output stream of a program. The environment you run the program from determines where this stream points to. You are probably running the program from either a console terminal or from some IDE.
Console terminals by default store the output internally themselves, unless instructed to redirect the output to a file or another program's input.
You can't rely on third party to store any output info for you to later query without any agreement. You'll want to hold enough data inside your program to generate views you want. And yes, as above stated, ncurses and such libraries make console app building a bit easier.