:
float y[4][3] = {
{ 1, 3, 5 },
{ 2, 4, 6 },
{ 3, 5, 7 },
};
is a completely-braced initialization:
1, 3, and 5 initialize the first row of the array
y[0],
namely
y[0][0],
y[0][1],
and
y[0][2]. Likewise the next two lines initialize
y[1]
and
y[2]. The initializer ends early and therefore
y[3]s
elements are initialized as if explicitly initialized with an
expression of the form
float(),
that is, are initialized with
0.0. In the following example, braces in the
initializer-list
are elided;
however the
initializer-list
has the same effect as the completely-braced
initializer-list
of the above example,
float y[4][3] = {
1, 3, 5, 2, 4, 6, 3, 5, 7
};
The initializer for
y
begins with a left brace, but the one for
y[0]
does not,
therefore three elements from the list are used
. Likewise the next three are taken successively for
y[1]
and
y[2]. —
end example