Capturing cout in Visual Studio 2005 output window?

后端 未结 7 1583
北海茫月
北海茫月 2020-12-05 15:15

I created a C++ console app and just want to capture the cout/cerr statements in the Output Window within the Visual Studio 2005 IDE. I\'m sure this is just a setting that I

7条回答
  •  南方客
    南方客 (楼主)
    2020-12-05 15:32

    You can't do this.

    If you want to output to the debugger's output window, call OutputDebugString.

    I found this implementation of a 'teestream' which allows one output to go to multiple streams. You could implement a stream that sends data to OutputDebugString.

提交回复
热议问题