Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - access to inherited members http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
                        Access to Inherited Members
   Normally  inherited members within a derived class can be accessed  in
   the same way as normal class members. However there are two situations
   when  ambiguity might arise. Either the derived class  might  redefine
   its  own instance of the member, or it might inherit two members  with
   the same name from separate base classes. In such cases it is possible
   to  resolve the ambiguity by preceding the member name with  the  base
   class and scope resolution operator (this combination is known as  the
   class scope operator). The syntax is
   Base::member

   Redefinition of an inherited member's name in the derived class causes
   the  inherited member to be hidden. The inheritance of a  member  with
   the  same name from two or more base classes will generate a  compiler
   error if used without the scope resolution operator. Alternatively, if
   member  functions are involved the preferred solution is to provide  a
   derived  class member function which will hide the inherited  members,
   and  still  provide their functionality  for  instance  by  explicitly
   invoking the hidden methods.


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson