How to jump around in the code?

I'm making a text adventure in C++, and I would like to know how to jump around in the code for each event that could happen in the code. The text adventure is a bit complex, as there are several ways the game could go and therefore end, and I would like to know how to do that without an insanely long series of if statements.

If I can't jump around in the code, then is there any way I can make this work, and how?
Congratulations! Through your realization, you're on your way to learning what object-oriented programming means.
I'm not being sarcastic or anything. Most beginners don't see an alternative to hardcoding 'if' constrol structures everywhere.

I like to describe this paradigm as the following:

A data-driven approach, versus a hardcoded approach.
I suggest you study classes, containers (if you aren't familiar with them), pointers and polymorphism. There's a big learning curve, but if you're serious, then the time investment is easily worth it. Check out the documentation page here:
http://www.cplusplus.com/doc/tutorial/
Topic archived. No new replies allowed.