title: How to deallocate a structure of dynamic size
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2486034/delete-an-array-of-objects">delete[] an array of objects</a>  </p>
  </blockquote>
  
  
  
  <p>The memory is allocated as follows:</p>
  
  <pre><code>struct foo {
    int size;
    int * arr;
  };
  
  (*structA).arr = new int[(*structA).size];
  </code></pre>
  
  <p>How does one deallocate it?</p>