title: Accessing variables in a union inside a struct
body: <p>Can anyone please explain why the 1st method of accessing a nested struct element inside an union in a struct works and the 2nd does not?</p>
  
  <pre><code>typedef struct element Node;
  struct element
  {
      int type;
      union
      {
          int value;
          Node *child[2];
      } u;
  };
  int main()
  {
      Node n;
      Node *p;    
      n.type = 0;
      p = n.u.child[0];
      p-&gt;type = 10;  // 1st method
      (n.u.child[1])-&gt;type = 24;   // 2nd method
      return 0;
  }
  </code></pre>