More than C code, I believe an English definition would suffice:
If given a Base class and a Derived class, dynamic cast will convert a Base pointer to a Derived pointer if and only if the actual object pointed at is a Derived object.
class Base { virtual ~Base() {} };
class Derived : public Base {};
class Derived2 : public Base {};
class ReDerived : public Derived {};
void test( Base & base )
{
dynamic_cast<Derived&>(base);
}
int main() {
Base b;
Derived d;
Derived2 d2;
ReDerived rd;
test( b ); // throw: b is not a Derived object
test( d ); // ok
test( d2 ); // throw: d2 is not a Derived object
test( rd ); // ok: rd is a ReDerived, and thus a derived object
}
The call to test in the example binds several objects to a reference to Base.
Internally, the reference is typesafely downcast to a reference to Derived: the downcast will succeed only if the referred object is an instance of Derived.