title: Dynamic memory allocation for Union
body: <p>I have a union of following type, for example</p>
  
  <pre><code>typedef union
  {
       typedef struct
       {
            short int a;
            short int b;
            short int c;
            short int d
       }str1;
       short int my_array[x];
  }union1; 
  </code></pre>
  
  <p>Here I want to allocate memory to array dynamically which will be always more than what <code>str1</code> needs. What are the changes that I need to apply in the above code so that I will be able to allocate memory to <code>my_array</code> dynamically?</p>