Jump to content
Tom Next - Daytrading Community

MQL5 :: Aufruf einer rein virtuelle Funktion übergeordnete einer child class


Recommended Posts

Posted

MQL5 :: OOP (object oriented programming)

Ein Beispiel für den Aufruf einer rein virtuelle Funktion übergeordnete einer child class.

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class CBase  {
public:
  virtual void      Create() { Print("Base");}  };
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class CChildren : public CBase  {
public:
  virtual void      Create() 	{      CBase::Create();
     Print("Child"); 	}  };
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()  {
//---
  CChildren Child;   Child.Create();  }
  • Upvote 3

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...