Best way to store inventory items in c++

TArray will work fine. Just make a TArray of PickUpItem classes and add them as you get them. You may even consider making a 2D array so that it’s easier to keep track of different types of items, i.e. Inventory[1] holds weapons, [2] armor, etc etc. Depending on what exactly your goal is, you’ll likely have to do more than that, but starting with TArray as a base should be fine.

As an aside, I currently use this to good effect in my current project.