How can I see cout output in a non-console application?

后端 未结 8 2173
醉话见心
醉话见心 2021-02-06 22:10

It seems rather tedious to output to debug window. Where can I find cout output if I am writing a non-console information ?

Like:

double          


        
8条回答
  •  渐次进展
    2021-02-06 22:36

    To output a string to the debug console, use OutputDebugStringA. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa363362%28v=vs.85%29.aspx

    To output variable values to the debug console, using std::ostringstream, the send the string to OutputDebugStringA.

    Excessive output statements will cause the program to severly slow down. However, it is a good technique to catch things the debugger has a problem with, such as the actual child members when playing with base pointers.

提交回复
热议问题