[Solved] Inheriting a base class using vector


vector is template container defined in the STL header <vector> and a part of namespace std . Simply put, it acts like an array whose size can be changed just by adding a new element to it.

Just like you store objects of some datatype in an array (for eg. int, char, or any other type of object etc.), you can create a vector to store objects.

In your case vector<base*> is a class to hold pointers to objects of datatype base. since its a class, publicly inheriting a derived class from vector<base*> means that the derived class will have all the member variables and functions from vector<base*> and can have something extra (or even improvements) in addition to these.

solved Inheriting a base class using vector