3.7.7. Designated inits

As in C99, designated initializers are supported.

Example

int a[6] = { [4] = 29, [2] = 15 };
int b[6] = { 0,0,15,0,29,0 }; // a[] is equivalent to b[]

Mode

Supported in GNU mode for C90 and C++ only.

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential