In the GNU C Reference Guide :
When using either ISO C99 or C89 with GNU extensions, you can initialize array elements out of order by indicating which array indices are initialized. To do this, include the array index in brackets and, optionally, the assignment operator, before the value. Here is an example:
int my_array[5] = { [2] 5, [4] 9 };
Or using the assignment operator:
int my_array[5] = { [2] = 5, [4] = 9 };
Both of these examples are equivalent:
int my_array[5] = { 0, 0, 5, 0, 9 };
source share