Download MetaTrader 5

Special Constructor using inheritance ?

To add comments, please log in or register
Abejorro
185
Abejorro  

Hello,

my problem: Two classes, one inherits. But, the inherited class has to be constructed with a parameter... And I can't make it...

FatherClass:

class clsGauss01

      clsGauss01(int Index);

SonClass:

class clsGaussTS01 : public clsGauss01(0)

But the Message:

'0' - declaration without type    clsGaussCalcTS01.mqh

Is there a way to make it like my trial above - like in c ? I can work around with a simple instance, but this one-line-way would be more comfortable.

Many thanks in advance for your help

whroeder1
15311
whroeder1  
class clsGaussTS01 : public clsGauss01{
 public:
   clsGaussTS01(int v=0) : clsGauss01(v){} // Ctor
   :
};
Abejorro
185
Abejorro  

WHRoeder:

class clsGaussTS01 : public clsGauss01{
 public:
   clsGaussTS01(int v=0) : clsGauss01(v){} // Ctor
  
};



Great !! - Is working. Thank you very much !
To add comments, please log in or register