问题描述
这可能是一个令人尴尬的问题,因为答案无疑是显而易见的.
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?
推荐答案
从 Visual Studio 2017 (15.9.4) 开始有一个选项:
Starting from Visual Studio 2017 (15.9.4) there is an option:
Tools->Options->Debugging->Automatically close the console
相应片段来自Visual Studio 文档:
调试停止时自动关闭控制台:
告诉 Visual Studio 在调试会话结束时关闭控制台.
Tells Visual Studio to close the console at the end of a debugging session.
这篇关于防止控制台窗口在 Visual Studio C/C++ 控制台应用程序上关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!