从收盘的Visual Studio C / C ++控制台应用程序preventing控制台窗口 [英] Preventing console window from closing on Visual Studio C/C++ Console application

查看:109
本文介绍了从收盘的Visual Studio C / C ++控制台应用程序preventing控制台窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个可能是一个embarasing问题是毫无疑问的答案是言自明。

This is a probably an embarasing question as no doubt the answer is blindingly obvious.

我使用的Visual Studio多年,但这是我第一次做任何'控制台应用程序的发展。

I've used Visual Studio for years, but this is the first time I've done any 'Console Application' development.

当我运行我的应用程序控制台窗口弹出,程序的输出出现,然后在窗口关闭的应用程序退出。

When I run my application the console window pops up, the program output appears and then the window closes as the application exits.

有没有办法要么保持打开,直到我已经检查了输出,或查看结果的窗口关闭后?

Is there a way to either keep it open until I have checked the output, or view the results after the window has closed?

推荐答案

如果您运行不带调试(Ctrl + F5键),则默认情况下它会提示你到preSS返回关闭窗口。如果你想使用调试器,你应该把一个断点在最后一行。

If you run without debugging (Ctrl+F5) then by default it prompts your to press return to close the window. If you want to use the debugger, you should put a breakpoint on the last line.

这篇关于从收盘的Visual Studio C / C ++控制台应用程序preventing控制台窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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