When do we need to have a default constructor?
A default constructor is not synthesised if you created your own constructor with arguments. Since you gave Shape a constructor of your own, you’d have to explicitly write out a default Shape constructor now: class Shape { int k; public: Shape() : k(0) {} Shape(int n) : k(n) {} ~Shape() {} }; (You can leave … Read more