By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,804 Members | 1,627 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,804 IT Pros & Developers. It's quick & easy.

equivalent of Java's getErrorStream in C++ - need to capture standard error

P: n/a
vj
I need to capture the error code put out by an executable which I run
from my program using

rc = system(command);

I get the stdout into rc. But how do I get to stderr ?
( command does cerr << errorcode; as part of its execution)

Can this be done without creating a file ?

Thanks in advance for your help.
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
vj wrote:
I need to capture the error code put out by an executable which I run
from my program using

rc = system(command);

I get the stdout into rc. But how do I get to stderr ?
There is no way to do that in C++.
( command does cerr << errorcode; as part of its execution)

Can this be done without creating a file ?


Yes, by using OS-specific means, like opening a pipe instead of using
'system', etc. Off-topic here, ask in a newsgroup for your OS.

Victor
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.