title: Ordered Array Initialization Syntax in C
body: <p>I came across an unfamiliar array initialization syntax in the code of <a href="http://pdos.csail.mit.edu/6.828/2012/xv6.html" rel="nofollow noreferrer">xv6</a>.
  Original code is in syscall.s</p>
  <pre><code>static int (*syscalls[])(void) = {
  [SYS_fork]    sys_fork,
  [SYS_exit]    sys_exit,
  [SYS_wait]    sys_wait,
  // ...
  [SYS_halt]  sys_halt,
  };
  </code></pre>
  <p>I ran my sample code to confirm this</p>
  <pre><code>const char* mystrings[] = {
     [2] &quot;this&quot;,
     [1] &quot;is&quot;,
     [0] &quot;cool&quot;,
  };
  
  
  int main (int argc, char const* argv[])
  {
     printf(&quot;%s %s %s\n&quot;,mystrings[0],mystrings[1],mystrings[2]);
  
          return 0;
  }
  </code></pre>
  <p>Output was</p>
  <pre><code>cool is this
  </code></pre>
  <p>What is this kind of array initialization in C code? Where can i ( find documentation for this? ( I compiled with gcc 4.6.3 )</p>