After debugging, the black box flashes back, and the following error is displayed.
The reason:
Debugging mode at this time, the program will not be suspended, so the window will not continue to open state. So when the black box appears, it goes away.
Solution logic:
Causes the program to pause in a wait state.
Some compilers, such as Visual 6.0, perform this function automatically at the end of code execution.
Solutions:
Method 1: As shown in Figure 1, add a statement before the return statement: system (” pause “); System (” Pause “); Call the system pause command.
,
Method 2: getchar () before the return statement;
Either of the above methods can be used.
So it runs successfully.
The reason:
Debugging mode at this time, the program will not be suspended, so the window will not continue to open state. So when the black box appears, it goes away.
Solution logic:
Causes the program to pause in a wait state.
Some compilers, such as Visual 6.0, perform this function automatically at the end of code execution.
Solutions:
Method 1: As shown in Figure 1, add a statement before the return statement: system (” pause “); System (” Pause “); Call the system pause command.
,
Method 2: getchar () before the return statement;
Either of the above methods can be used.
So it runs successfully.
Read More:
- Flashback problem of output window of visual studio 2017 console program
- Solution of command line window flashback when visual studio runs C + + program
- The solution to the black window flash of running program on Visual Studio
- Solution to the flashback of visual studio output window
- [solution] visual studio will exit automatically after debugging the program
- There are three ways to deal with the problem of vs (Visual Studio) 2017 flashback. I feel that none of them is the fundamental solution.
- Solve the problem of visual studio console flashback
- The problem of flash back by pressing enter window when debugging or executing program in Visual Studio C
- Visual studio 2012, a complete collection of solutions to flash back windows after running
- Solve the problem of “Visual Studio debugging flash back”
- The problem of black box flash away in vs2019 debugging
- Some solutions to the problem of windows flashback after vs running
- MDK (keil) debugging often appears flashback phenomenon solution.
- Three solutions to command line flashback in VS
- Visual studio console program output window flashed by
- Solution to the flash of visual studio console program output window
- Detailed steps for installing Visual Studio 2010 + Intel parallel studio Xe 2013 and configuring mpich2
- When IntelliJ idea is programmed, 1. Black thick line or black cursor appears; 2. The solution of carriage return unable to wrap. (practical recommendation method 2)
- Solve the problem of flash back in Visual Studio 2010
- Solution to the flash of visual studio 2017 running program