Ok, tried the following that worked. It would be nice to include this in the help :)
class Child : public Parent{
public:
void Test(){
Parent::Test();
Print("Child");
}
};
GoD2.0:
Ok, tried the following that worked. It would be nice to include this in the help :)
class Child : public Parent{
public:
void Test(){
Parent::Test();
Print("Child");
}
};
https://www.mql5.com/en/docs/basis/operations/other - Scope resolution operation - example
::Print("parent GetLastError",CCheckContext::GetLastError());
Documentation on MQL5: Language Basics / Operations and Expressions / Other Operations
- www.mql5.com
Language Basics / Operations and Expressions / Other Operations - Documentation on MQL5

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
Hi
I'm trying to call a base class's virtual function inside of a derived class with the same function name. Consider the following:
When i do this the program crashes due to stack overflow, because it calls the Test from the child, not from the parent. In C++ you could do something like:
or
I'm trying to do this because I have a parent function that does some initializations, and I want to do them in the child in a function besides the other initializations with the same name so I can maintain naming conventions.