nThe dynamic_cast operator relies on information stored in an object by the compiler whenever a direct or indirect base class contains a virtual
function. This cast is used
when downcasting to determine at run
time if the downcast is valid or not.
nThe dynamic_cast operator
syntax is
n dynamic_cast<type*>(expr)
n where expr is
an expression pointing to a direct or indirect base class object and type is a derived class.
nexpr is converted to a
pointer of the specified type if the dynamic
type of the object pointed to is that type or is a type derived from that type. Otherwise, the result of the cast operation is zero.