Stack class constructor

StackX: :StackX () {
pArr = new double [10];
maxSize = 10;
top = -1;
}
May I know one disadvantage of having the above constructor.
What is missing in it?
It is better to use constructor initializer list instead of assigning in h constructor body:

StackX::StackX() : pArr(new double[10]), maxSize(10), top(-1) {}

But there is not much of a difference in yr answer and my constructor.Can someone come up with a better way to write this constructor I ve given pleeeeeeease
Can someone come up with a better way to write this constructor
This is a most efficient way to define a default constructor which will create a stack with maximum size of 10 without changing class and making assumptions about other constructors existence.
Oh okay thankyou!
Topic archived. No new replies allowed.