I'm a beginner, that goes without saying - and I have a question that won't be a bummer to anyone who has spent a week more than me in c++. So this is the beef:
I'm making an adventure game (classic beginners game) text based and what not, but for my first time I want to make something that isn't linear. I know how functions work fundamentally, I can make the code jump between them and all that - but what I don't get, is how I can make an inventory function that I call to view the list of items the character has.
This might sound like a roadkill right here, like "How the f- wouldn't he figure that out?" You see, I have the definitions of functions in another source file, for convenience - and let's say that I keep track of whether the player has an item or not by using bool variables - that don't... exist in the scope of the inventory function - What do I do?
Should I create the variables outside any scope - something people pretty much laughed at me for doing last time I did, or should I find a better way to write this code? I'm extremely sorry if this is facepalm-tier, I really just want to know.