Is there any way to exit with an event in c++ ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Is there any way to exit with an event in c++ ?

I am using Visual C++ Compiler that works from command line. It generates a .exe and a .obj file. When I run the exe file manually from windows explorer, it closes immediately after the last cout statement. So is there any way that at the end it will ask to user to press enter key to exit.

5th Jun 2017, 11:44 AM
Siddharth Saraf
3 Answers
+ 3
can able to do in c++??
5th Jun 2017, 11:57 AM
Bhavin Kanzariya
Bhavin Kanzariya - avatar
+ 2
@Ranjeet please don't ask for challenge, just start without asking here and there.
5th Jun 2017, 11:51 AM
Siddharth Saraf
+ 1
try getch()
5th Jun 2017, 2:57 PM
Igor B
Igor B - avatar