开发者

redirect process output [closed]

开发者 https://www.devze.com 2023-01-26 08:53 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_如何学编程 Closed 10 years ago.

I have 2 processes. I need proces1 to show what's also shown in process2.

I use c/c++ in Windows and the processes are console application.

I guess will use pipe. But how?


What do you mean "also show?" I assume process1 writes to stdout and process2 somehow needs access to that output? So you'd run the two programs like this: process1 | process2. In which case you just need to use std::cout in process1 and std::cin in process2 to do the reading (and possibly also write using std::cout again if you want the output of process1 to be visible in the terminal).

0

精彩评论

暂无评论...
验证码 换一张
取 消