help in text game

Started by
0 comments, last by rip-off 16 years, 11 months ago
I am learning C++ I know some simple things. I was making a text game but had some problems. My main problem was that in my game if you get killed I want it that the game close but I dont know how can you do for it to close, if it is possible because I dont know
Advertisement
The safest way is to return from main, with a value of "0" to indicate success.

A more flexible but less safe method is to call std::exit(0) from the include file <cstdlib>. Beware that this doesn't properly call destructors for C++ objects, which is bad style.

This topic is closed to new replies.

Advertisement