如何防止输出屏幕在Visual Studio 2013 C ++编译器中消失 [英] How to prevent output screen from disappear in Visual Studio 2013 C++ Compiler
问题描述
我刚刚下载了Visual Studio2013.编译C时,它没有显示我的输出.输出屏幕将显示一会儿,然后消失.
I just downloaded Visual Studio 2013. When I compile C, it doesn't show me my output. The output screen will show up for a brief second and then disappears.
#include <stdio.h>
int main()
{
printf("hi");
return 0;
}
程序'[5688] Project1.exe'已退出,代码为0(0x0)." 我知道我的代码可以正常运行,只是我无法让输出屏幕保持打开状态,而不用等待一秒钟.
"The program '[5688] Project1.exe' has exited with code 0 (0x0)." I know my code works and run correctly except I just can't make the output screen stay on without exiting after a second.
推荐答案
您可以在调试模式和发布模式下运行应用程序.通常,Ctrl + F5
将在没有调试器的情况下运行该应用程序.然后F5
只需运行该应用程序即可.
You can run the application in debug mode and in release mode. Normally Ctrl + F5
will run the application without debugger. And F5
just runs the application.
如果您执行Ctrl+F5
(无需调试即可开始"),则控制台始终保持打开状态,并要求您在Press any key to continue . . .
此处查看输出.
If you do Ctrl+F5
("Start without Debugging"), the console remains open at the end and asks you to Press any key to continue . . .
here you can see the output.
如果仅使用F5
,则处于调试模式.最后,在retuen 0;
之前添加getchar()
功能,以便控制台将一直等到您按任意键...
If you are just using F5
then you are in a debug mode. At the end you add, getchar()
function before retuen 0;
so the console will wait until you press any key...
这篇关于如何防止输出屏幕在Visual Studio 2013 C ++编译器中消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!