Hi,
i'm slightly confused about this run time polymorphism. correct me if i am wrong, run time polymorphism means, function definitions will get resolved at run time.
take this example..
class a
{
a();
~a();
void baseclass();
}
class b: class a
{
b();
~b();
void derivedclass1();
}
class c: class a
{
c();
~c();
void derivedclass2();
}
calling methodology..
b derived1;
a *baseptr = &derived1; //here base pointer knows that i'm pointing to derived class b.
baseptr->derivedclass1();
in the above calling methodology, base class knows that its pointing to derived class b. so where does the ambiguity exist? in what cases we call, the function definitions will get resolved at run time.?