title: How do I initialize a const struct with a union in C
body: <p>I've been trying to solve this problem for hours now. Although I found some similar questions, it just won't work.
  I have a union within a struct. Now I want to initialize a const variable of this struct. </p>
  
  <pre><code>struct length
  {
     int minutes;
     int seconds;
  };
  
  typedef struct article
  {
     char name[MAXLENGTH_A]
     double price;
     char type;
     union size
     {
        int pages;
        struct length blength;
     } bsize
  } art;
  </code></pre>
  
  <p>Now I want to initialize a const variable of this struct. I read somewhere that the following should work, but it doesn't. I always get the errors: 
  C2224: The operand to the left of '.pages' is not a class, structure, or union and
  C2078: To many Initializers</p>
  
  <pre><code>const art book = {"Title", 24.99, NORMAL, { .pages = 50}};
  </code></pre>
  
  <p>I know that this example could be solved easier. But my real problem is, to initialize the 2nd element of the union, like this:</p>
  
  <pre><code>const art book = {"Title", 24.99, AUDIO, { .blength.seconds = 40}};
  </code></pre>
  
  <p>Neither the first, nor the second initialization is working. 
  Can someone tell me how do it right? I'm using C99 btw.</p>