Because the program statement is executed sentence by sentence, nothing makes it pause, at the speed of computer execution, of course, flash by.
What we need to do is make the system wait and pause so that it doesn’t flash back (some compilers automatically add this feature at the end of the code to prevent novice users from seeing the output).
1) add system(“pause”) before return;
Note: system() is the call to the system command; Pause command; “Press any key to continue..”
;
;
;
Note: getchar reads the next character, so it “pauses” while waiting for us to type.
It’s worth noting that sometimes you might need to add two getchar(), because the first getchar() might eat the carriage return or something like that.
3) Press Ctrl +F5 to run
Note: Ctrl +F5 is a program that debugs without debugging. It automatically “pauses” at the end of the program, so the DOS command prompt “Press any key to continue….” is added.
The little triangle we clicked on, which starts debugging (F5), does not automatically add “pause”, so it will flash past.
The above is only the idea after I consult the data to think, welcome everyone fellow middlemen to give correct, next will be very grateful!
Read More:
- Three solutions to flash back of program running result box under vs
- Vs error prompt: “unable to open source file XXXX. H” possible reasons and Solutions
- 2、 Solutions to the problem of flash back in vs2017
- Sophus Library Issues (Reasons & Solutions)
- How to Solve Azkaban error (Reasons & Solutions)
- Flash back after vs compiler running, processing method
- Solve the problem of flash back in VS2010
- Visual studio 2012, a complete collection of solutions to flash back windows after running
- Mac reports an error zsh: fork failed: resource temporarily unavailable (reasons and solutions)
- Solution for flash back of vs2015 running interface
- Make DOS window wait and not flash back in VS
- C language program running results flash back how to do
- Flash back record of vs2017 installation process
- The problem of flash back by pressing enter window when debugging or executing program in Visual Studio C
- Summary of solutions to open flash back problem after Python packaging
- Several reasons of program flashback crash
- Solution to the problem of console output window’s CMD flashing back when vs2015 writes C + + program
- The reasons for the following errors occurred when opening the webgl project of unity
- Reasons for being rejected immediately after telnet
- [Handling Notes] Alternative reasons for Configuration system failed to initialize exception