Here is what I'm doing.... I made a function and I want it to exit the program if some one calls it. for example
void exit()
{
What code goes in here to make it exit the game?
}
Whats the code to exit the game in C++?
Don't see why you are making your own exit.
stdlib.h
already provides a function for that.
================================
exit();
// parameter 0 or 1
Reply:alt+f4 closes it completely,,, not quite sure if thats what your looking for.
Reply:Well name it something other than exit().
#include %26lt;cstdlib%26gt;
void myExit()
{
exit(EXIT_FAILURE);
}
You can also use abort(). Or if you want to play around you can add exit functions with atexit(). Read up on that before hand so you know what to expect and don't hurt yourself.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment