Content deleted Content added
→Initializer: C++ does not allow designated initializers. Added citation. |
Reverted to revision 483374349 by Cybercobra: spam. (TW) |
||
Line 5:
==C family of languages==
===Initializer===
In C/C99/C++, an '''initializer''' is an optional part of a [[declarator (computing)|declarator]]. It consists of the '=' character followed by an [[expression (programming)|expression]] or a comma-separated list of expressions placed in curly brackets (braces). The latter list is sometimes called the "initializer list" or "initialization list", although the term "initializer list" is formally reserved for initialization of class/struct members in C++, see below.
A declaration which includes initialization is commonly called '''definition'''.
Line 21:
char tx[3]="fa";
char ty[2]="fa";
struct point {int x; int y;} p = { .y = 13 , .x = 7 };
</source>
|