Printing output on the Output Window in Visual C++ IDE

前端 未结 5 1647
生来不讨喜
生来不讨喜 2021-01-06 12:38

How do I print on the output window in Visual C++? The project that I am working on isn\'t of a console window project type. That\'s when I build and run it, it doesn\'t ope

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-06 12:49

    You can use the Windows function OutputDebugString (see here) to send output to debuggers. These outputs are shown in the VS output window. You can also watch these outputs with external applications, e.g. DebugView.

    Remember to remove these statements from your production code if you don't want other people to see these debug messages (which would otherwise be possible using tools like DebugView...)

提交回复
热议问题