title: Memory Allocation for union
body: <p>In the following code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      union a {
          int i;
          char ch[2];
      };
      union a u;
      int b;
      u.ch[0] = 3;
      u.ch[1] = 2;
      printf("%d,%d,%d\n", u.ch[0], u.ch[1], u.i);
      return 0;
  }
  </code></pre>
  
  <p>The output I get is</p>
  
  <pre><code>3,2,515
  </code></pre>
  
  <p>Can anyone explain me why the value of <code>i</code> is <code>515</code>?</p>