launch an exe/process with stdin stdout and stderr?(使用 stdin stdout 和 stderr 启动 exe/进程?)
问题描述
使用 C++,我如何使用 stdin stdout 和 stderr 启动 exe/进程?我知道如何在 .NET 中执行此操作,我记得过去使用过 popen 但 popen 似乎允许 stdin 或 stdout 不是两者都允许,也不是全部 3.
With C++ how do i launch an exe/process with stdin stdout and stderr? I know how to do this in .NET and i remember using popen in the past but popen seems to allow stdin OR stdout not both and not all 3.
我需要在 Windows 上使用它,但欢迎使用 linux 解决方案,因为我将来会在同一个项目中使用它.
I need this for windows but a linux solution is welcome as i'll need it for the same project in the future.
推荐答案
可移植的解决方案是 boost.process
(注意:这已被提议为 Boost 库,并在相同的许可条款下发布,但未正式接受.另见 Boost.Process 在哪里?)
(Note: this has been proposed as a Boost library, and released under the same license terms, but not officially accepted. See also Where is Boost.Process?)
这篇关于使用 stdin stdout 和 stderr 启动 exe/进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 stdin stdout 和 stderr 启动 exe/进程?


基础教程推荐
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 常量变量在标题中不起作用 2021-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09