View Single Post
Old 06-01-2005, 09:42 AM   #6
Data
retired
 
Data's Avatar


 
Join Date: Jun 2004
Location: Jan Mayen, Svalbard and Jan Mayen
Posts: 2,167
Default


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
Data is offline                         Send a private message to Data
Reply With Quote