Solution to the flash of visual studio 2017 running program

Add an input statement to the end of the editor: cin.get(); In this way, the user will be required to input characters before the end of the program (or the Enter key can close the window), and the console will remain in existence before the input. The specific code is shown in the figure below

Add system(“pause”) at the end of the editor; After adding this sentence, the console will display “Please press any key to continue” after displaying the result of running. The specific code is 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 on the left of the pop-up dialog box –>; ‘Linker’ –>; “System”, and then in the list on the right, in the first “subsystem” value, select “Console (/SUBSUSTEM:CONSOLE)” as shown in the figure below

Read More: