a function returning class a (which is in reality a class B)
then casting that "a" to a " b"
that's dynamic casting example
a* input;
b* result= dynamic_cast<b*>(input);
if b is not in reality a a then null is returned (well I think actually a exception is thrown)
you do this let a function accept both "b" and "c" through the "a" baseclass pointer.
__________________
Flowing with the stream of life
|