title: C struct initialization using labels. It works, but how?
body: <p>I found some struct initialization code yesterday that threw me for a loop.  Here's an example:</p>
  
  <pre><code>typedef struct { int first; int second; } TEST_STRUCT;
  void testFunc() {
      TEST_STRUCT test = {
          second: 2,
          first:  1
      };
      printf("test.first=%d test.second=%d\n", test.first, test.second);
  }
  </code></pre>
  
  <p>Surprisingly (to me), here's the output:</p>
  
  <pre><code>-&gt; testFunc
  test.first=1 test.second=2
  </code></pre>
  
  <p>As you can see, the struct gets initialized properly.  I wasn't aware labeled statements could be used like that.  I've seen several other ways of doing struct initialization, but I didn't find any examples of this sort of struct initialization on any of the online C FAQs.  Is anybody aware of how/why this works?</p>