How would I create an inventory list in a game?

I was wondering what the most effective way to create an inventory list. Should I create a vector, put the items in separately, create a class, or what?
This is a far too general question to have a single suitable answer. There is no one size fits all answer for this. It depends on the game, the items, how the items are going to be used, etc, etc, etc.
Just throwing these ideas out there.

You could use filestreams to acess/edit text files and in turn, create an actual save system. When your program exits and you restart it, you would still have your stats from last time.
Maybe a struct with vectors? Have a file that has all the data in it (depending on the type of inventory) with name and price or whatever data you want. Probably a terrible idea, but the first thing I thought of when I read this.
Topic archived. No new replies allowed.