August 2012
Intermediate to advanced
976 pages
30h 17m
English
The default constructor is used automatically whenever an object is default or value initialized. Default initialization happens
• When we define nonstatic variables (§ 2.2.1, p. 43) or arrays (§3.5.1, p. 114) at block scope without initializers
• When a class that itself has members of class type uses the synthesized default constructor (§ 7.1.4, p. 262)
• When members of class type are not explicitly initialized in a constructor initializer list (§ 7.1.4, p. 265)
Value initialization happens
• During array initialization when we provide fewer initializers than the size of the array (§ 3.5.1, p. 114 ...
Read now
Unlock full access