title: C++ allocation, construction and destruction questions
body: <p>Q1. In the following line of code, what happens first: memory allocation, or the constructor call?</p>
  
  <pre><code>int *ptr = new int();
  </code></pre>
  
  <p>Q2. What is the difference between the following three approaches to delete an object?</p>
  
  <ol>
  <li>If an object is destroyed with <code>DELETE</code> operator; is it's destructor invoked?</li>
  <li>If a destructor is called explicitly (e.g. <code>a1.~A()</code>) to destroy the object?</li>
  <li>The object simply goes out of scope (i.e. Neither an explicit destructor call nor the <code>DELETE</code> operator used).</li>
  </ol>
  
  <p>What would be the behavior if the destructor is private or protected?</p>