Problem:
When I use VS to write a c/c program, the running result box always flashes away, and I can’t see the result of the program running at all.
Solution:
1. Before the return 0; statement, add a getchar(); statement. In this way, getchar will always wait for input, and the program execution result box will display normally. Result.
2. Add the statement: system("pause"); at the end of the program, plus the header file #include
3. Modify the project configuration, right-click the project, select Properties in the right-click menu, and then select the list on the left side of the pop-up dialog box Select "Configuration Properties--->Linker--->System", and then in the list on the right, select "Console (/SUBSUSTEM:CONSOLE)" in the value of the first item "Subsystem"
Related learning recommendations: vscode tutorial
The above is the detailed content of vscode running program result box crashes. For more information, please follow other related articles on the PHP Chinese website!