[dcl.init.aggr] (original) (raw)

[Example 12:

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 arrayy[0], namelyy[0][0],y[0][1], andy[0][2].

Likewise the next two lines initializey[1]andy[2].

The initializer ends early and thereforey[3]'s elements are initialized as if explicitly initialized with an expression of the formfloat(), that is, are initialized with0.0.

In the following example, braces in theinitializer-listare elided; however theinitializer-listhas the same effect as the completely-bracedinitializer-listof the above example,float y[4][3] = { 1, 3, 5, 2, 4, 6, 3, 5, 7 };

The initializer forybegins with a left brace, but the one fory[0]does not, therefore three elements from the list are used.

Likewise the next three are taken successively fory[1]andy[2].

— _end example_]