What is the code for terminating the C++ exefile program? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the code for terminating the C++ exefile program?

I mean if you press any key to it, it will automatically close the program.. so what is it? can u pls. help me?

13th Jan 2017, 1:00 PM
Bernard Frank Obida
Bernard Frank Obida - avatar
1 Answer
+ 8
1) #include <cstdlib> system("pause"); at the end of the program, before return 0; (But don't use that one, it's bad) 2) cin.get(); My favourite 3) getch(); (getchar();)
13th Jan 2017, 8:19 PM
Filip
Filip - avatar