title: When do we need to have a default constructor?
body: <p>My question is simple. When do we need to have a default constructor? 
  Please refer to the code below:</p>
  
  <pre><code>class Shape
  {
      int k;
  
  public:
      Shape(int n) : k(n) {}
      ~Shape() {}
  };
  
  class Rect : public Shape
  {
      int l;
  
  public:
      Rect(int n): l(n)
      {}      //error C2512: 'Shape' : no appropriate default constructor available
  
      ~Rect() {}
  };
  </code></pre>
  
  <ol>
  <li><p>Why is the compiler not generating the zero argument default constructor implicitly in the class Rect?</p></li>
  <li><p>As per my knowledge, if a class (Rect) is derived from another class (Shape) that has default constructor (either implicitly generated or explicitly provided), the default constructor should be generated by the compiler.</p></li>
  </ol>