Reading from the screen
How would you read in text that is displayed in the current window?
You evoke the command "Dir C:\" using system in stdlib.h.
How would you read in all the stuff, that the OS spits back at you?
If the answer is really obvious, its because I'm really new at this.
Now you can open the file "output.txt" which will contain all the info displayed on the screen from the call to dir
system( "dir C:\\ > output.txt" );
In Dos/Win console mode you can redirect input or output using > and <
program < input.txt > output.txt
That would run program and instead of using the keyboard for cin, it would use input.txt for cin. and instead of displaying to the screen, it would print to the file output.txt