Internally capture/redirect stdout?

后端 未结 4 1474
梦如初夏
梦如初夏 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 08:07

    Once it's gone out, it's gone. If you want to compile it all into a single executable, you'll have to go through the code for A with a search and replace and change all those printf calls into ones to your own stream, where you can copy them and then pass them on to stdout.

提交回复
热议问题