调试windows程序时如何查看printf?

调试windows程序时如何查看printf?,windows,winapi,mfc,Windows,Winapi,Mfc,可能重复: 我正在调试用winmain启动的windows程序。里面有smome printf,我想知道是否可以在某处查看printf输出?我需要一些特殊工具吗?假设您使用的是VC++,您可以使用它在IDE中显示输出 比如: wchar_t buffer[512] wsprintf(buffer, L"Value is %d\n", value); OutputDebugString(buffer); 试试这个: AllocConsole(); freopen("CONOUT$", "wb"

可能重复:


我正在调试用winmain启动的windows程序。里面有smome printf,我想知道是否可以在某处查看printf输出?我需要一些特殊工具吗?

假设您使用的是VC++,您可以使用它在IDE中显示输出

比如:

wchar_t buffer[512]
wsprintf(buffer, L"Value is %d\n", value);
OutputDebugString(buffer);
试试这个:

AllocConsole();
freopen("CONOUT$", "wb", stdout);
// your printf()

fclose(stdout);
FreeConsole();