I am trying to make a text-based RPG game and part of it looks something like this:
1 2
if (hp<0){ cout
<< "You died....";
Is it possible to call upon the main function to restart the game?
If not, is it possible to terminate a program through a function other than int main()?
Unless I am mistaken, there is not a way to put a do while loop inside a function.
You are mistaken, it is just the opposite: there is no way to put a do-while loop outside a function. It must be within the curly braces of a function to compile.
It was a mistake, I meant to write:
@L B
The problem is, I have more than one function in my game.
Unless I am mistaken, there is not a way to put a do while loop outside a function.
Im afraid I don't know what that would do.
I get my knowledge from what I consider a great book, but I'm not all the way through it.
I think I have a solution.
Can you call another void function from a first void function?