在Visual C ++ IDE中的输出窗口上打印输出 [英] Printing output on the Output Window in Visual C++ IDE

查看:618
本文介绍了在Visual C ++ IDE中的输出窗口上打印输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Visual C ++中的输出窗口上打印?我工作的项目不是控制台窗口项目类型。这就是当我构建和运行它,它不打开控制台窗口。相反,它打开一个win32应用程序,这不是我建的。我只是添加了东西。

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 open a console window. Instead, it opens a win32 application, which isn't built by me. I am just adding things to it.

我对C ++非常新,因为我不能在任何控制台上打印变量,这使我很难调试。

I am pretty new to C++ and because I couldn't print variables out on any console, it makes it very hard for me to debug.

由于Visual Studio 2010项目在构建和运行它时不会启动控制台,我仍然可以在Output窗口的输出窗口打印输出,如变量和其他IDE?

Since the Visual Studio 2010 project doesn't launch console when I build and run it, can I still print outputs such as variables and others on the Output window of the IDE?

感谢您的帮助。

推荐答案

使用 OutputDebugString(...); 打印到Visual Studio的Output窗口。你必须 #include< windows.h>

You can use OutputDebugString("..."); to print to the Output window of Visual Studio. You have to #include <windows.h> though.

这篇关于在Visual C ++ IDE中的输出窗口上打印输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆