help in text game
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
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.
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
Popular Topics
Advertisement