Solution of vs program flashback problem

As you would expect in the following program, the control is out of control in a flash after running, so we are now going to solve this problem in our code in the following ways

1. The getchar ()

This statement is to wait for user input, implementation program pause

2.system(“pause”)

This statement causes the system command program to pause, so adding this statement before return 0 causes the program to pause

3. The while (true)

This is easy to understand, but it may not be appropriate for some applications

4. Run the program using Ctrl+F5

In VS, because we built the project originally, it was an empty project

> Properties of the project> “Configuration properties”>> “linker”> Subsystem The item “subsystem” in “System” is changed to “Console”

After doing this, press Ctrl+F5 again and the program will end up in the console screen

Read More: