Close a program

+1 Arnab Banerjee · March 5, 2015
How to close or terminate a program using c++ code ??

Post a Reply

Replies

Oldest  Newest  Rating
+2 Adam Tindall · March 5, 2015
cin.ignore().get();

return 0;

}

I like to use this at end of program to terminate and pause so I can see result. If you just want to close out just return 0.  Or what Arjun mentioned while running.
+2 Dol Lod · March 5, 2015
exit(0) will terminate the program in code. If you mean exit the program while it is running use control x control c if on linux. If on a mac, use alt control x control c. 
  • 1

C++

106,998 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator