How to read text from console?

Hi,
I would like to know can I read text from the console? Text is drawn in the console window so it's in RAM and I assume that it should be possible to access it.
I don't mean input only. I mean whole text including one writen with cout . I want to read it all as a big text file.
The way streams work, what you're asking is impossible with them.
BUT, there's a different solution. Google ncurses or PDcurses, and then read this: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/
If you are on Windows, you can also use the ReadConsoleOutput() function.
http://msdn.microsoft.com/en-us/library/ms684965(VS.85).aspx

You'll also want to use the GetStdHandle() and GetConsoleScreenBufferInfo() functions.

Good luck!
Topic archived. No new replies allowed.