Internally capture/redirect stdout?

后端 未结 4 1471
梦如初夏
梦如初夏 2020-12-18 07:32

This seems like a bit of a computing systems 101 question, but I\'m stumped.

I am integrating existing code from C/C++ project A into my own project B. Both A and B

4条回答
  •  無奈伤痛
    2020-12-18 07:49

    Before you printf(), you could close fd 1, and dup2() a pipe that you've created into fd 1.

提交回复
热议问题