D
DJ.precario
In a schematic way, I have a program with a virtual base class
(MyClass), and some derived classes (MyClass1, Myclass2...)
In main, I want to create a vector of objects of the classes that
derive from MyClass. My question is:
-Can I have such a vector with actual objects of different kinds but
all deriving from MyClass or does it have to be a vector of pointers to
such objects?
-How would I declare such a vector?
Many thanks
DJ
(MyClass), and some derived classes (MyClass1, Myclass2...)
In main, I want to create a vector of objects of the classes that
derive from MyClass. My question is:
-Can I have such a vector with actual objects of different kinds but
all deriving from MyClass or does it have to be a vector of pointers to
such objects?
-How would I declare such a vector?
Many thanks
DJ