i want to be sure if i understand that corectly. If i have something like that:
Base* wsk = new Derived
and if i've done that with static-binding than wsk is type of Base, but Derived type object is still created? And wsk is pointing to that Derived type object, but it cannot use methods from derived class, because wsk is Base type? To sum up the most important question for me is that if wsk except that it's Base type is still pointing to new object which is Derived type?
wskis of typeBase *, notBasenorDerived.It was initialised with a value that was (implicitly) converted from type
Derived *. It points to aBaseobject, which so happens to reside within aDerivedobject.That means that
static_cast<Derived *>(wsk)will give you a value that points to aDerived.It may be that the representation of
wskis the same number as the representation ofstatic_cast<Derived *>(wsk), i.e. that the address of theBaseobject is the same as the address of theDerivedobject, but that is not guaranteed