Suppose we have a class like the following one:
class myprogram {
public:
myprogram ();
private:
double aa,bb,cc;};
myprogram::myprogram():aa(0.0),bb(0.0),cc(0.0){}
As you can see we can initialize our private members' aa, bb, cc using the myprogram() constructor.
Now, suppose I have a large private array G_[2000]. how I could initialize all the values of this array equal to 0 using a constructor.
class myprogram {
public:
myprogram ();
private:
double aa,bb,cc;
double G_[2000];};
myprogram::myprogram():aa(0.0),bb(0.0),cc(0.0){}