Initialization (programming): Difference between revisions

Content deleted Content added
Reverted 7 edits by 82.33.220.162 (talk). (TW)
Navinwiki (talk | contribs)
Initializer list: I've corrected an important concept about initialization lists where variable values are not assigned but initialized
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 assignsis initialimportant to note that when you use an initialization list, the values are not assigned to the membersvariable. ofThey are initialized. In the class/structbelow example, 0 is initialized into re and objectim.
Example:
<source lang="c">