Inventory/List

I am wondering what would be the best way to create an inventory class or list, to store and possibly display the Items-Weapons-Potions that I have created. I am pretty new to programming and arrays confuse me. An example would be much appreciated.

Last edited on
I would be inclined to use either a std::set or a std::map.

Use a std::set if you don’t need any kind of key to access individual elements. Use a std::map if you do.

Enjoy!
Topic archived. No new replies allowed.