qmf_t X_hybrid_left[32][32] = { /* Row initializers next */ { /* Col initializers next */ { /* Struct initializers next */ 0 } } }; qmf_t a = {0}; qmf_t b[5] = {{0}}; qmf_t c[10][5] = {{{0}}};
From specifications C11, 6.7.9. Initialization .
initializer:
Assignment expression
{initializer-list}
{initializer-list,}
Although in your particular case (zeroing all objects from 2 arrays), qmf_t X_hybrid_left[32][32] = {0}; will work the same as qmf_t X_hybrid_left[32][32] = {{{0}}}; but the compiler can warn you.
But if you want any non-zero initialization, you need to use several curly braces.
In the same section:
[16] Otherwise, the initializer for an object that has an aggregate or type of union must be in parenthesized list of initializers for elements or named elements.
[20] If an aggregate or association contains elements or elements that are aggregates or unions, these rules apply recursively to subaggregates or combined unions. If the initializer sub-aggregate or containing the union begins with the left bracket, the initializers enclosed in this bracket and the corresponding right bracket initialize the elements or elements of the sub-aggregate or containing the union. Otherwise, only initializers from the list are enough. accepted for accounting elements or members of a sub-aggregate or the first member of a joint union; any remaining initializers to initialize the next element or member of the population that is part of or a combined element.
source share