i am writing this code which involves an eatery type class and 2 derived classes
snackcart and restaurant. how can i implement polymorphism in this? i want to make use of dynamic objects.
the thing is in my main function i have not created a snackcart object as a pointer. it have created it as a vector. does vector have its own destructor? and which part of the code doesnt make sense? i think the *meals is not required and neither is the destructor. is that it?
vector<> has its own destructor that runs the destructor of all contained elements.
Well, for example, the base class Eatery has a string owner member, but the getter and setter
for that member is pure virtual. And Eatery has a Meal* and a size (an array?), yet all the
derived classes have vectors of Meals. Do the derived classes need both their own vector of
Meals AND an inherited array of Meals?