title: How to initialize anonymous composite types in C
body: <p>Given something like (adapted from <a href="https://stackoverflow.com/q/1972003/1010226" title="How to use anonymous structs / unions in C?">another post</a>):</p>
  
  <pre><code>struct {
      union {
          struct {
              float x, y, z;
          };
          float xyz[3];
      };
      int a;
  } v = { /* what goes here? */ };
  </code></pre>
  
  <p>how do I initialize it in place? I know I have to use a designated initializer for the <code>xyz</code> member, but do I have to do the same if I want the first set of members instead?</p>
  
  <p>...</p>
  
  <p>Looking at <a href="https://stackoverflow.com/q/5063548/1010226" title="initialization of anonymous structures or unions in C1X">yet another post</a>, its examples deal only with anonymous structs, and not unions, but I guess the syntax would be</p>
  
  <pre><code>//...
  } v = { someX, someY, someZ, someA };
  </code></pre>
  
  <p>which initializes the three members of the first variant of the union, then the <code>int</code> that follows the entire union part.  Is this right?</p>