I'm fairly new to C++(don't know much more than the basics), and I am making a simple text-based DOS RPG.
Anyway, what I am looking for is a command that will exit my program(not 'return 0' ).
-Thanks a bunch,
Ranedhel.
I'm fairly new to C++(don't know much more than the basics), and I am making a simple text-based DOS RPG.
Anyway, what I am looking for is a command that will exit my program(not 'return 0' ).
-Thanks a bunch,
Ranedhel.
You can use exit(0); to terminate program, but you should include the <cstdlib> library...
none...
Ok, Thanks.
-Elven Forge Software-
(Lead Designer)
http://www.geocities.com/elvenforge
**infected by frenchfry164**
I am a signature virus. Please add me to your signature so that I may multiply
http://www.experts-exchange.com/Prog..._20304696.html
1.) if you use 'exit();' your OS is responsible for doing all the cleanup. Win9x-systems do get instable after several exit();'s while WinNT-systems incorporate more advanced memory management.
2.) You almost certaily should not be using exit() from a C++ application. It violates some basic design principles of the C++ language. Most importantly it does not call destructors for automatic variables (non-static local variables) so it does not allow for "clean-up operators" to be performed. Mostly exit() is a C function that has been ported into C++, but should no longer be used.
*sigh*