cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Inventory/List
Inventory/List
Apr 12, 2019 at 7:41pm UTC
Conan420
(1)
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
Apr 13, 2019 at 5:13pm UTC
Apr 12, 2019 at 8:03pm UTC
Duthomhas
(13214)
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.