When writing C/C ++ programs in VS, the result box will always flash away, and you can’t see the results of the program. This is really annoying, so here are three ways to solve it
Method one:
In the return 0; Before the statement, add a getchar(); In this case, getchar will wait for input, and the result box will display the result of the program.
As shown in the figure below:


Method 2:
Add the statement system(“pause”) at the end of the program; , plus the header file #include< stdlib.h> “, which will display the results after running them and prompt you to press any key to continue.
As shown in the figure below


Method 3:
To modify the project configuration, right-click on the project, select Properties from the right-click menu, and then select “Configuration Properties –>” from the list to the left of the pop-up dialog. The linker – & gt; System “, and then in the list on the right, in the first “subsystem” value, select “Console (/SUBSUSTEM:CONSOLE)”
As shown in the figure below:



From:
https://blog.csdn.net/rannianzhixia/article/details/66968219?locationNum=6& fps=1
Method one:
In the return 0; Before the statement, add a getchar(); In this case, getchar will wait for input, and the result box will display the result of the program.
As shown in the figure below:


Method 2:
Add the statement system(“pause”) at the end of the program; , plus the header file #include< stdlib.h> “, which will display the results after running them and prompt you to press any key to continue.
As shown in the figure below


Method 3:
To modify the project configuration, right-click on the project, select Properties from the right-click menu, and then select “Configuration Properties –>” from the list to the left of the pop-up dialog. The linker – & gt; System “, and then in the list on the right, in the first “subsystem” value, select “Console (/SUBSUSTEM:CONSOLE)”
As shown in the figure below:



From:
https://blog.csdn.net/rannianzhixia/article/details/66968219?locationNum=6& fps=1
Read More:
- Solution to the flash of visual studio 2017 running program
- The solution of console flash in C + +
- Vs output flashback
- The solution of flashing back after the end of console program running
- The perfect solution of VS2010 console program running in a flash
- Three methods of how to remove the flashback of running result box in VS
- Why does the result screen flash when visual studio runs the program?
- Solution of vs program flashback problem
- C language — to solve the problem of program flashback when programming (in VS)
- Solution to the flash of visual studio console program output window
- Flashback problem of output window of visual studio 2017 console program
- Causes and solutions of black frame flashback after debugging visual studio 2017
- C language program running results flash back how to do
- Solution to the problem of console flash in vs2017 runtime
- Solution for flash back of vs2015 running interface
- Vs2015 configuring OpenGL development environment: configuration of glfw library and glad Library
- How to center the box horizontally and vertically in HTML
- The problem of running result window flash of vs2015
- [solution] visual studio will exit automatically after debugging the program