Re: call base class function or derived class function



Sorry Igor,


My bad, it should be

int main()
{
Goo g;
g.goo();
return 0;
}

Any comments to my original question?


regards,
George

"Igor Tandetnik" wrote:

"George" <George@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D2239B4B-C837-4A30-85E9-EF73BB005F1F@xxxxxxxxxxxxx
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
object.
--
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



.