I have a question regarding declaring my inventory. I made it a string named inventory, with a constant number as its max value. The thing is, I want the user to use an item if he / she gains an item. The problem is, I do not know what syntax should I use to determine if the user has an item and use that item. Here's my code I just started:
so declaring the inventory:
const int MAX_ITEMS = 15; string game_inventory [MAX_ITEMS]; int itemnum = 0;
I have some items like potion, antidote, gems and others. I use the:
game_inventory[itemnum++] = "Potion"
to place items in my inventory. If I want to use the potion, IF I HAVE one, how can i make a function to check whether I have a potion or anything and use it?