title: Catching exceptions in constructor
body: <p>The following example leave a possible memory leak because the destructor doesn't run for the object on which the exception is handled during its constructor is run. where do i handle this memory leak?</p>
  
  <pre><code>#include &lt;exception&gt;
  
  class MyClass {
  
  public:
         MyClass() 
         {
             c = new char[5];
             throw std::runtime_error("test");
         }
  
        ~MyClass ()
         {
             delete[] c;
         }
  
  private:
      char *c;
  };
  
  int main()
  {
      try 
      {
          MyClass Obj;
  
      } 
      catch (std::runtime_error)
      {
  
      }
  }
  </code></pre>