Re: call base class function or derived class function

Sorry Igor,

My bad, it should be

int main()
Goo g;;
return 0;

Any comments to my original question?


"Igor Tandetnik" wrote:

"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
I am just a little confusing and not 100% confident about the
following case. In the following sample, function call foo (called in
function goo in class Foo) will call foo in class Goo

Your example never calls goo(). If it were called on some object, it
would call foo() override that belongs to the dynamic type of that
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925