Suppose I\'m given a C++ library full of inheritance. I\'m given a Base* in a function when I know that it is actually pointing to a Derived object and
Base*
Derived
Use static_cast. If you know that your Base* points to a Derived, then use static_cast. dynamic_cast is useful for when it might point to a derived.
static_cast
dynamic_cast