1

Somebody told me that if you initialize the data members inside the constructor body, they are essentially being overwritten on their previously initialized values. The previous initialization apparently occurs in the constructor initializer list just like the constructor of a superclass subobject does if you don't do it yourself.

Is this true?

If a class has an int data member, and you initialize it (to 10) inside the body of the constructor, it first gets initialized to a default value i.e 0 before it enters the constructor body and then it gets ovewritten to 10 is it?

qwerty
  • 2,065
  • 2
  • 28
  • 39
Blood Brother
  • 105
  • 1
  • 2
  • 7

0 Answers0