A dynamic_cast can cast from a polymorphic virtual base class to a derived class or a sibling class. The dynamic_cast requires a polymorphic operand because there is no information stroed in a nonpolymorphic object that can be used to find the objects for which it represents a base. run time check is performed.
The static_cast operator converts between related types such as one pointer type to another in the same class hierachy,an enumeration to an integral type, or a floating-point type to an integral type. compile time check is performed.
The static_cast operator converts between related types such as one pointer type to another in the same class hierachy,an enumeration to an integral type, or a floating-point type to an integral type. compile time check is performed.
static_cast Used for conversion of nonpolymorphic types.
const_cast Used to remove the const, volatile, and __unaligned attributes.
-------------from MSDN.
thanks!!
thank masterz()
can you give me some examples??