Artifact [b873f24c9d]
Not logged in

Artifact b873f24c9dfa7cbf380b3320fb999c06837069e8:

Wiki page [Calling overridden base methods] by Les Farrell 2013-01-17 21:52:30.
D 2013-01-17T21:52:30.838
L Calling\soverridden\sbase\smethods
U Les\sFarrell
W 829
<p><i><b>Calling overridden base methods</b></i></p>

<p><i><br>
</i></p>

<p><i>Any base class method can be called by explicitly stating its class and
name, separated by the :: double-colon scope operator. This is useful to call
base method that have been overridden by derived class methods.</i></p>

<p><i><br>
</i></p>

<p><i>It is important to get the syntax order correct by ensuring that the base
class name and the scope operator immediately precedes the object name. The
syntax looks like this:</i></p>

<p><i><br>
</i></p>

<p><i><b>object-name.base-class-name::method-name();</b></i></p>

<p><i><br>
</i></p>

<p><i>The example demonstrates how to explicitly call the two overridden base
<b>walk</b> class methods. It uses the same <b>mammal3.hpp</b> and <b>cat3.hpp</b>
header files listed on pages 140-141.</i></p>

Z 21bc37a97edd80599ed909186de5664d