31

How do I quit a C++ program. Which function is called to end a program and which values does the method take?

To clarify I want to exit a C++ program from within my code. And I may want to exit the program outside of the main function of this program.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Janusz
  • 187,060
  • 113
  • 301
  • 369
  • Although it is unusual to close an older question as a duplicate of a more recent one, the new question has better answers, and contradicts (or, at least, gives a more complete and nuanced answer that largely contradicts) the recommendation here, and with cogent reasons. – Jonathan Leffler May 16 '15 at 16:54
  • http://meta.stackoverflow.com/questions/251938/should-i-flag-a-question-as-duplicate-if-it-has-received-better-answers – Paul Draper May 16 '15 at 21:47

0 Answers0