How to prevent output screen from disappear in Visual Studio 2013 C++ Compiler

后端 未结 10 1917
悲&欢浪女
悲&欢浪女 2020-12-24 08:23

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.



        
相关标签:
10条回答
  • 2020-12-24 09:02

    I use Visual Studio 2013 for Python and I also struggle with that problem. My solution is to press F5instead of Ctrl + F5, then I will have 2 pop-up windows (console and program output).

    I close the console window and the other will be closed together.

    0 讨论(0)
  • 2020-12-24 09:03

    You can run the application in debug mode and in release mode. Normally Ctrl + F5 will run the application without debugger. And F5just runs the application.

    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.

    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...

    0 讨论(0)
  • 2020-12-24 09:04

    I just put a breakpoint (F9 key) on the return 0 statement. Works only in debugging mode, but that's precisely what you want. If you run the program directly from the command line, it already works as intended.

    0 讨论(0)
  • 2020-12-24 09:07

    Another option in addition to what's already been mentioned is to go into the properties for the project and change the Subsystem in the System section in the Linker options to Console (/SUBSYSTEM:CONSOLE). Then the console window will remain when you run the program using ctrl+f5 (Debug/Start without debugging).

    MSDN reference for the subsystem option.

    0 讨论(0)
提交回复
热议问题