static_cast<> does not do run time type checking. That's why base
class  pointer can be changed to drived class though it actually is a
base class pointer. Now its a drived class pointer, you can call
drived class functions. If you use dynamic_cast<> instead of
static_cast<>, it will throw a bad cast exception, because
dynamic_cast<> does runtime type checking.

 Regards,
 Amit

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to