如何停止退出时关闭控制台? [英] How to stop console from closing on exit?

查看:103
本文介绍了如何停止退出时关闭控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2010和Windows 7 x64

I'm using Visual Studio 2010 and Windows 7 x64

即使我使用无调试启动",退出后命令提示符也会关闭.我可以在某处使用设置吗?

The command prompt closes after exit, even though I used "Start without debug". Is there a setting somewhere that I can use?

推荐答案

您只需按 Ctrl + F5 而不是 F5 即可运行内置的代码.然后它将提示您按任意键继续.或者,您可以在代码末尾使用此行-> system("pause");,使其等到您按任意键.

You can simply press Ctrl+F5 instead of F5 to run the built code. Then it will prompt you to press any key to continue. Or you can use this line -> system("pause"); at the end of the code to make it wait until you press any key.

但是,如果使用上面的行system("pause");并按 Ctrl + F5 运行,它将提示您两次!

However, if you use the above line, system("pause"); and press Ctrl+F5 to run, it will prompt you twice!

这篇关于如何停止退出时关闭控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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