Special Constructor using inheritance ?

Back to topics list To post a new topic, please log in or register
avatar
39
Abejorro 2016.03.07 13:09
 


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

avatar
12985
WHRoeder 2016.03.07 16:10 #
 
class clsGaussTS01 : public clsGauss01{
 public:
   clsGaussTS01(int v=0) : clsGauss01(v){} // Ctor
   :
};

avatar
39
Abejorro 2016.03.07 22:20 #
 

WHRoeder:

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



Great !! - Is working. Thank you very much !
Back to topics list  

To add comments, please log in or register