I have a vector of objects (DimensionItem) and I want to push another item to the vector. I only have a pointer to the object I wish to push. How can I get the object from the pointer.
(New to pointers, very possible I'm am fundamentally misunderstanding something)
DimensionItem *selected_Item = dynamic_cast<DimensionItem*>(g_items[i]); //g_items is a list of items taken from my scene
vector<DimensionItem> DimItems;
DimItems.push_back(selected_Item);
The error message is:
no matching function for call to 'std::vector::push_back(DimensionItem*&)'