【发布时间】:2010-02-14 04:18:42
【问题描述】:
可能重复:
How can I run an external program from C and parse its output?
嗨,
有人可以告诉我们在执行 system() 函数时如何捕获结果吗?
实际上我写了一个显示机器IP地址的c++程序,叫做“ipdisp”,我希望当服务器程序执行这个ipdisp程序时,服务器捕获显示的IP地址。那么,这可能吗?如果是,怎么做?
感谢您的回复
【问题讨论】:
-
被问过很多次。一个例子:stackoverflow.com/questions/43116/…
-
对不起,我写这个问题的时候不知道,我没有看到相关的问题。谢谢!