title: Initializing an array of structs, why does using struct variables not work
body: <p>I am extremely new to C. Would appreciate if someone can help understand why code in lines 13,14 and 16 does not work, but lines 17-20 works.</p>
  
  <p>With the first option (lines 13, 14 and 16) I get the error</p>
  
  <pre><code>error: initializer element is not constant
  </code></pre>
  
  <p>What does this mean? Also, does this mean one cannot use variables of certain type to generate new variables?</p>
  
  <p>Thank you.</p>
  
  <pre><code>// Define structure for a good
    5 struct good {
    6     char goodname;
    7     double p; //starting proportion
    8     int theta; //average utility
    9     int sigma; //variance of error
   10 };
   11
   12 // The goods H and L
   13 struct good H = {.goodname = 'H', .p = 0.5, .theta = 100, .sigma = 20};
   14 struct good L = {.goodname = 'L', .p = 0.5, .theta = 75, .sigma = 20};
   15
   16 struct good goods[2] = {H, L}; // **Does not work**
  
   // ** Works**
   17 struct good goods[2] = {
   18     {.goodname = 'H', .p = 0.5, .theta = 100, .sigma = 20},
   19     {.goodname = 'L', .p = 0.5, .theta = 75, .sigma = 20}
   20 };
  </code></pre>