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 - redefining a virtual function http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   Redefining a Virtual Function
   A function declared as virtual in a base class remains as virtual when
   inherited.  The  derived  class may provide its  own  version  of  the
   virtual function or inherit that of the base class by default. If  the
   derived class provides its own version, it does not need to re-specify
   the  virtual  keyword. A derived class which inherits a  pure  virtual
   function  must provide its own version of the function, otherwise  the
   derived  class  also becomes an abstract class.  Derived  classes  may
   themselves  contain  virtual functions which are  not  inherited  from
   their base classes.

   The  redefinition of a virtual function in a derived class must  match
   exactly  the name, types and number of arguments and return  value  of
   the base class instance. The definition of a virtual function  whether
   in  the base or derived class is identical to that of a normal  member
   function. Non-identical definitions are not treated as virtual in  the
   derived class, they are instead treated as an overloaded definition.


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