B
BCC
Hi,
If I have a base class with a virtual function defined:
class CBase {
virtual void Foo();
};
void CBase::Foo()
{
// base class functionality
}
and a derived class which overrides the base class Foo():
class CDerived: public CBase {
void Foo();
};
CDerived::Foo()
{
// derived functionality
}
If I had a pointer to an object of type CDerived, how can I call the base
classes version of Foo() rather than the polymorphic version?
CDerived derived;
CDerived* p_derived = &derived;
p_derived->Foo(); // Want to somehow be able to call base class Foo()!
I think there is a simple way to do this, but I can't find it.
Thanks,
B
If I have a base class with a virtual function defined:
class CBase {
virtual void Foo();
};
void CBase::Foo()
{
// base class functionality
}
and a derived class which overrides the base class Foo():
class CDerived: public CBase {
void Foo();
};
CDerived::Foo()
{
// derived functionality
}
If I had a pointer to an object of type CDerived, how can I call the base
classes version of Foo() rather than the polymorphic version?
CDerived derived;
CDerived* p_derived = &derived;
p_derived->Foo(); // Want to somehow be able to call base class Foo()!
I think there is a simple way to do this, but I can't find it.
Thanks,
B