I'm pretty new to C++ (hence posting in the beginners form). I'm making a text based adventure game, and one of the functions I have set up is a Battle class whenever a monster is encountered. I was wondering how I would go from the battle function BACK to the point where it left off. I want to only use one battle class that It will go back and forth between at many points.
Lets say I'm going from my Town class to the battle, how would I go back to where it left off in the Town class (in a manner that will return it to wherever it left off since I'll be using it quite a bit).
When your function finishes, which will happen when the return statement is reached, execution will go back to wherever the function was called.
Your terminology is a little confused. Your Battle class is not a function, it is a class (presumably; you've called it a class so I think it is a class, but for all I know it is actually a function and you've mistakenly referred to it as a class). It may contain functions, but it itself is not a function.