c++ - 与预编译程序的接口
问题描述
如何获取已编译的程序(控制台应用程序)并通过我的 C++ 代码与其通信?这样“打印”到程序中将与将我打印到程序控制台中的用户键入相同,并从中“读取”读取程序写入控制台的内容?
这是我想要的伪代码(最好没有外部库):
//also start (run) the program somehow
ProgramStream programStream = createStream("somepath/someprogram.exe")
programStream << "This will be written into the console of someprogram.exe" <<endl;
string result;
ProgramStream >> result; //gets what the program prints back
解决方案
推荐阅读
- taleo - Taleo 客户端连接复杂查询
- c - Scanf 在 Eclipse 中的 printf 之前执行
- c - Tizen Native Service:无法同时访问位置和心率
- javascript - 以 html 形式验证正确年龄的问题
- functional-programming - Spring WebFlux - 如何从流中间返回响应?
- python - 雅虎财务错误:“NoneType”对象不可下标
- python - 使用带范围的 for 循环填充空列表时检查用户输入
- ffmpeg - 用于转换 h.265 的最有效的网络格式
- python - 如何在“字段”元组中包含外键字段以使其显示在 Django Admin 的详细视图页面上
- javascript - 带有生命周期钩子的事件驱动 NodeJS 应用程序架构