J
Jim
Hi, can someone explain to me if virtual functions need to be invoked
by a pointer to the object (not just a normal object) in order to
facilitate polymorphism?
So, in this example:
class BaseClass
{
...
virtual vfunc();
...
}
class DervicedClass
{
...
vfunc();
...
}
BaseClass b;
DerviedClass d;
b = d;
b.vfunc();
Will DerivedClass's vfunc be called?
Thanks in advance.
by a pointer to the object (not just a normal object) in order to
facilitate polymorphism?
So, in this example:
class BaseClass
{
...
virtual vfunc();
...
}
class DervicedClass
{
...
vfunc();
...
}
BaseClass b;
DerviedClass d;
b = d;
b.vfunc();
Will DerivedClass's vfunc be called?
Thanks in advance.