Let's say I have a base class 'A' and two classes 'B' and 'C', which are derived from the base class 'A'
I know I can do this
A *a = new B();
or
A *a = new C();
a->handle() //handle is a virtual function in A. class B and C overloaded this function and added its own implementation.
Then it will call the handle function from either B or C object.
But, I have a restriction that I cannot use a pointer in my program. I have to define A as
A a //not A *a
Then how do I implement this so that it calls the handle function from class B or C?