Click to See Complete Forum and Search --> : reading the stdout and/or stderr


honae
March 22nd, 2006, 12:24 PM
Can anyone tell how a read the stdout in c or c++?

philkr
March 22nd, 2006, 12:36 PM
You cannot read it, because it is an output. The only thing you can do is to redirect it to a file or a pipe.

honae
March 22nd, 2006, 01:03 PM
what I'm trying to do is call a program a catch its output whithout redirecting to a file. it is possible?How can I do this?

NoHero
March 22nd, 2006, 01:11 PM
The following links shall help you:

http://www.codeguru.com/forum/showthread.php?t=337227
http://www.codeguru.com/Cpp/misc/misc/article.php/c277

Especially the MSDN example:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/creating_a_child_process_with_redirected_input_and_output.asp