You can pass object of class B
and class C
by reference.
ex: void play(A* b,A* c);
since B
and C
is the child of A
, the pointer of A
can hold the object. but you need to declare all the functions of B
and C
which you want to use in Class D
inside Class A
.