class - c++: Dynamically choose which subclass to create -
I'm new to c ++ and I have any questions.
We say that we have a base class base and have two derivative classes, Derived1 and Derived2 eg Derived1 have a constructor in which an integer and a conclusion that the cooler takes a boolean.
Is it possible to determine whether on the runway (or in time compilation), which of the two subclasses is the base class?
Something like this: base b = ??? (Value), where the value is of integer or boolean.
Thanks in advance!
You probably want to
Comments
Post a Comment