title: Structures and Unions in C, determining size and accessing members
body: <p>All,</p>
  
  <p>Here is an example on Unions which I find confusing.</p>
  
  <pre><code>struct s1
  {
      int a;
      char b;
      union
      {
         struct
         {
            char *c;
            long d;
         }
         long e;
       }var;
  };
  </code></pre>
  
  <p>Considering that <code>char</code> is 1 byte, <code>int</code> is 2 bytes and <code>long</code> is 4 bytes. What would be the size of the entire struct here ? Will the union size be {size of char*}+ {size of double} ? I am confused because of the struct wrapped in the union. </p>
  
  <p>Also, how can I access the variable <code>d</code> in the struct.  <code>var.d</code> ?</p>