Destructor for multiple constructors
<p>I have two constructors in C++ and one destructor. When I use the first constructor for my object the destructor is called to delete A[] which is what I want, but when I used the second constructor I don't need to call destructor but C++ compiler calls it anyways which causes an error. What is the best way to solve this problem?</p>

<pre><code>Tree(int n) {

  A = new int[n];
}

Tree(int data*, int n) {
   A = data;
}

~Tree(){

   delete [] A;
}
</code></pre>
