Category Archives: How to Fix

To solve the problem of flashback of calling class function of glutsolidcube() in Win32 program

The problem
Functions such as glutSolidCube() are used in Win32 to flash back without reporting an error.
To solve
GlutSolidCube, GlutSolidSphere and other functions will first check whether GLUT is initialized, and exit the program if GLUT is not initialized.
Therefore, put the following code in WinMain() :

int argc = 0;
char *argv[10] = {};
glutInit(&argc, argv);

Can solve

Solve the problem of visual studio console flashback

On the top navigation bar, click “Project” ->; “Properties” – & gt; ‘Configure Properties’ –>; “Linker” –>; “System” – & gt; “Subsystems (there is a drop-down icon on the right side of the window)” –>; SUBSYSTEM:CONSOLE -> drop down box select ‘/SUBSYSTEM:CONSOLE’ -> Finally “confirm” –>; Click on the top right corner of “File” –>; “Save it all.”

The problem of flash back by pressing enter window when debugging or executing program in Visual Studio C

In the process of learning C with Visual Studio, we sometimes finished typing the code and found that the program could execute as well. But is it ever frustrating to press the enter key to execute the next command in the program and see the window flash back?Don’t worry. Just type the following simple code.
Just add the last line:
system(” pause “);
, don’t forget “; “Oh.
# include< stdio.h>
#include< stdlib.h>
main()

y>oplaceholder0;
*************;
*************;
system (” pause “); // Don’t forget the semicolon
}

Visual studio 2012, a complete collection of solutions to flash back windows after running

Visual Studio 2012, flash back window after the solution of operation

I believe you all have a kind of want to beat the rhythm of the person, every time to write the code, after the code is written, run the compiled code but the result of window flashback, below, I will introduce several solutions to Visual Studio 2012 run window flashback method. I hope I can help you solve this problem.
Method 1: Press Ctrl +F5 to run the program, and then run the program.
This method is only to solve the general flash back, rookie level novice if there is a flash back, might as well try this method, Xiaobian when just contact VS, is to use this method to solve.
//add system(“pause”) before Main’s returrn = 0;
This method can solve most of the flashback problem, of course, some more advanced, Xiaobian temporarily do not know whether this method has any effect, and so on later contact will be constantly updated.
Method 3: Use getchar() before return. This method can also solve the flashback problem, but you have to try it out slowly.
Method 4: Flashback will occur when an exception is encountered. To solve this problem, it is generally necessary to check the various plug-ins of VS itself, which may be caused by the expiration of plug-ins.
Method 5: you can try to set the debugging type to native or mixed only, this method is not always effective, the specific effective Xiaobian has not found the result, know the dear friends can also reply.
Inline void keep_window_open(char ch; cin> > ch;) , then add keep_Window_open() to the end of the mian function; This method is the most effective and the most commonly used, and the most effective method. (Recommended)
Method 7: Set breakpoint debugging method, press F9 to set breakpoint, press F10 to step debugging. This method is also very effective in finding errors.

The above is a summary of the solution to VS2012 flashback method, there are mistakes please point out, Xiaobian in this thank you. Of course, if there are other ways to reply, so that more latecomers can see, no longer bothered by the problem. Thanks for the flowers

Solution to the flash of visual studio 2017 running program

Add an input statement to the end of the editor: cin.get(); In this way, the user will be required to input characters before the end of the program (or the Enter key can close the window), and the console will remain in existence before the input. The specific code is shown in the figure below

Add system(“pause”) at the end of the editor; After adding this sentence, the console will display “Please press any key to continue” after displaying the result of running. The specific code is shown in the figure below

Method 3: To modify the project configuration, right-click on the project, select Properties from the right-click menu, and then select “Configuration Properties” from the list on the left of the pop-up dialog box –>; ‘Linker’ –>; “System”, and then in the list on the right, in the first “subsystem” value, select “Console (/SUBSUSTEM:CONSOLE)” as shown in the figure below

[solution] visual studio will exit automatically after debugging the program

1. Set breakpoint
Second, the system (” pause “)
(1) in the return 0; stem ("pause"); .
② Not using turn 0; stem ("pause"); ;
note: in the ACM or leetcode upload code to join this sentence complains;
3. Select the console program when creating a new project
If an empty project is selected, there will be an automatic exit problem.
Change the project configuration properties
opens the project properties and changes the subsystem to the console. (essentially the same as solution 3)

Two lines of code to solve your vs flashback problem

If you are a new programmer using VS, your code may be fine, but when you run the program, the DOS box will flash back.
At this point, add two lines of code to the end of the program to solve your flashback problem

Getchar ();
system(“pause”);

Ex. :
Ninety-nine multiplication tables
#include< stdio.h>
int main()
{
int i, j, m;
for (i = 1; i < = 9; i++)
{
for (j = 1; j < = i; j++)
{
m = i*j;
printf(“%d*%d=%d\t”, i, j, m);
}
printf(“\n”);
}
getchar();
system(“pause”);
return 0;
}

Several reasons of program flashback crash

There are many reasons for software crashes.
 
The

memory

1. Memory leak; 2. Load resource crash.
CPU 1. The program is too complicated.

software and hardware compatibility

1. The runtime environment and hardware support do not match. For example, the Android system does not match, and the software running environment is missing.

system memory recovery mechanism

1. The system will recycle foreground processes when memory is tight.

program internal mechanisms

1. Some plug-ins or code actively performs software exit when it detects an abnormal running state at runtime.

[Reprint please indicate the link of this article]