An array initializer consists of a sequence of variable initializers, enclosed by curly brace tokens and separated by comma tokens. Each variable initializer is an expression or, in the case of a multi-dimensional array, a nested array initializer. Array element initializers may also be used in array creation expressions.
The context in which an array initializer is used determines the type of the array being initialized. In an array creation expression, the array type immediately precedes the initializer. In a data member or variable declaration, the array type is the type of the data member or variable being declared. When an array initializer is used in a data member or variable declaration it is simply shorthand for an equivalent array creation expression.
In an array initializer, the outermost nesting level corresponds to the leftmost dimension and the innermost nesting level corresponds to the rightmost dimension. The initializer must have as many levels of nesting as there are dimensions in the array. All of the elements in the innermost nesting level must be implicitly convertible to the element type of the array. The number of elements in each nested array initializer must always be consistent with the size of the other array initializers at the same level.
If the array creation expression specifies the bounds of the dimensions, then the number of elements at any particular level must be the same as the size of the corresponding dimension. If the bounds are unspecified, then the length of each dimension is the number of elements in the corresponding level of nesting.
An empty array initializer (that is,. one that contains curly braces but no initializer list) is always legal regardless of the number of dimensions of the array. If the size of the dimensions of the array being initialized is known, then the empty array initializer represents an array instance of the specified size where all the elements have been initialized to the element type's default value. If the dimensions of the array being initialized are not known, then the empty array initializer represents an array instance in which all dimensions are size zero.
At runtime, the expressions in an array initializer are evaluated in textual order from left to right.
{
[ VariableInitializerList ] }
,
VariableInitializer