Okay here is my function
this funciton is supposed to end the game wen it is triggered, but it doesnt. how do I work with it so that the game will end when it is triggered?Code:void EndGame() { cin.get(); system("PAUSE"); }
Okay here is my function
this funciton is supposed to end the game wen it is triggered, but it doesnt. how do I work with it so that the game will end when it is triggered?Code:void EndGame() { cin.get(); system("PAUSE"); }
Last edited by StoryGame464; 06-09-2009 at 06:20 PM.
Ideally you should structure your logic so that when the game ends you'll exit all loops, return from all called functions, and leave main normally.
Your function naturally does nothing else than reads a character of input and runs the "pause" program, resuming after it terminates (any key pressed).
I might be wrong.
Quoted more than 1000 times (I hope).Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.