lucat:
CBase::Clear();
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;
}
};
Amir Yacoby:
CBase::Clear();
CBase::Clear();
THANKS A LOT
Works fine

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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;
}
};