What should I do if VS/VC crashes? Know these 4 tips!

Recently, I met some friends and asked what to do if VC crashed. Today, I will share the solution to the crash of VS/VC operation results.

 

VS/VC operation results crash solution:

1. Press ctrl+F5 to execute only without debugging

2. Manually call in cmd instead of directly

3. Join getchar   

Use the getchar() function to wait for input until you press Enter. If you don't press Enter, the console will always be in a waiting state, which is the step where the program's running results are displayed.

#include using namespace std;

int main(void)

{

cout<<"welcome!";

getchar();   

return 0;

}

Then enter any value to exit.

4. Call system functions

Add the header file #include "stdlib.h", use the system to call the system command, and realize it, so that the result will be displayed on the console after the operation is completed, and a prompt "Please press any key to continue".

#include<stdio.h>

#include<stdlib.h>

void main(void)

{

int a=10,b=36;

printf("%d+%d=%d",a,b,a+b);

system("pause");

}

The above is the detailed content of the VC operation result crash solution, I hope it helps everyone!

 

Finally, if you also want to become a programmer and want to quickly master programming, quickly join the learning penguin circle !

There are senior professional software development engineers who can answer all your doubts online ~ Introduction to programming language "so easy"

Programming learning books:

 

Programming learning video:

 

Guess you like

Origin blog.csdn.net/Hsuesh/article/details/112401023