如何使用Windows程序在C ++中获得控制台输出? [英] How do I get console output in C++ with a Windows program?

查看:106
本文介绍了如何使用Windows程序在C ++中获得控制台输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个原生的C ++ Windows程序(即入口点是WinMain)如何查看控制台函数的输出,如std :: cout?

If I have a native C++ windows program (i.e. the entry point is WinMain) how do I view output from console functions like std::cout?

推荐答案

查看将控制台I / O添加到Win32 GUI应用。这可以帮助你做你想要的。

Check out Adding Console I/O to a Win32 GUI App. This may help you do what you want.

如果您没有或无法修改代码,请尝试找到的建议此处将控制台输出重定向到文件。

If you don't have, or can't modify the code, try the suggestions found here to redirect console output to a file.

这篇关于如何使用Windows程序在C ++中获得控制台输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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