Is their any C popen() equivalent in C++ ?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can use the "not yet official" boost.process if you want an object-oriented approach for managing the subprocess.
Or you can just use popen
itself, if you don't mind the C-ness of it all.
回答2:
There is no C++ equivalent in any Standard, however C++ wrappers around this function (and other POSIX process function) can be found in various UI Toolkit (e.g QT, glibmm) and in the pstreams library.
回答3:
C++ is a superset of C. popen
is available to C++ code as well.