How to view printf output in a Win32 application on Visual Studio 2010?

后端 未结 7 1371
梦如初夏
梦如初夏 2021-02-01 05:48

How can you view printf output in a Win32 application (entering with a WinMain) in Visual Studio 2010?

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-01 06:10

    Here is a page that will tell you how to do this, including sample code.

    You must create a console window using AllocConsole(), then associate the C standard file handles to the HANDLEs of the new console window.

提交回复
热议问题