I have a design related question.
Say I have 2 classes, class A and class B
I havea third class classMain, where I want to use wither classA or classB at runtime based on some parameters.
I am planning to create a void pointer (as below) in the classMain and then point it either classA or classB object at runtime.
Are there any other alternatives to this approach?Code:classMain { ... .... void * classptr; }
Thanks in advance.