Jump to content
Tom Next - Daytrading Community

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


FinGeR

Recommended Posts

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...