What is the use case of the following examples:-
vector<Object> collection;
vector<Object> *collection = new vector<Object>
vector<Object*> collection;(creating the object on the heap)
When do I need to create a vector of pointers over a vector of objects and doesn't the vector (or any STL container) allocate the elements on the heap?
Aucun commentaire:
Enregistrer un commentaire