Initialization (programming): Difference between revisions

Content deleted Content added
Line 32:
 
===Initializer list===
In C++, a [[constructor (object-oriented programming)|constructor]] of a class/struct can have an '''initializer list''' within the definition but prior to the constructor body. It assigns initial values to the members of the class/struct object.
Example:
<source lang="c">