Home >Development Tools >VSCode >vscode running program result box crashes

vscode running program result box crashes

王林
王林Original
2020-02-12 15:46:3012747browse

vscode running program result box crashes

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.

vscode running program result box crashes

2. Add the statement: system("pause"); at the end of the program, plus the header file #include, so that the running result will be The results are displayed and prompted to press any key to continue.

vscode running program result box crashes

vscode running program result box crashes

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"

vscode running program result box crashes

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn