gpt4 book ai didi

c++ - 使用 stdin stdout 和 stderr 启动 exe/进程?

转载 作者:可可西里 更新时间:2023-11-01 16:39:42 26 4
gpt4 key购买 nike

在 C++ 中,我如何使用 stdin stdout 和 stderr 启动 exe/进程?我知道如何在 .NET 中执行此操作,我记得过去使用过 popen,但 popen 似乎允许 stdin 或 stdout,但不能同时允许 stdin 或 stdout,也不能同时允许 3 个。

我需要它用于 windows,但欢迎使用 linux 解决方案,因为我将来会在同一个项目中需要它。

最佳答案

可移植解决方案是 boost.process

(注意:这已被提议作为 Boost 库,并在相同的许可条款下发布,但未被正式接受。另请参见 Where is Boost.Process?)

关于c++ - 使用 stdin stdout 和 stderr 启动 exe/进程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5485923/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com