OOP for MQL4 - call from an Inherited class a method of the Parent class existing in both Classes

 

I have a CBase class and a CDerived class (inherited by CBase).

Both them have the public method "Clear"

How can I call from the Derived class the "Clear" method of the Base class

 // example 

class CBase

  {

      int myCount;

public:

                     CBase(void);

                    ~CBase(void);

      void Clear()   {myCount=0;}

  };


  

class CDerived : public CBase

 {

      int myDerivedCount;

public:

                    CDerived (void);

                   ~CDerived (void);

      void Clear()

      {

         CBase.Clear();  // This not work! - Is it possible to call the Clear of the CBase class???

         myDerivedCount=0;

      }

                      

 }; 

 
lucat:

I have a CBase class and a CDerived class (inherited by CBase).

Both them have the public method "Clear"

How can I call from the Derived class the "Clear" method of the Base class

 // example 

class CBase

  {

      int myCount;

public:

                     CBase(void);

                    ~CBase(void);

      void Clear()   {myCount=0;}

  };


  

class CDerived : public CBase

 {

      int myDerivedCount;

public:

                    CDerived (void);

                   ~CDerived (void);

      void Clear()

      {

         CBase.Clear();  // This not work! - Is it possible to call the Clear of the CBase class???

         myDerivedCount=0;

      }

                      

 }; 

CBase::Clear();
 
Amir Yacoby:
CBase::Clear();

THANKS A LOT

Works fine