Initialization (programming): Difference between revisions

Content deleted Content added
No edit summary
Line 29:
 
===Initializer list===
AIn C++ a [[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">