Default constructor

Note that a constructor with formal parameters can still be called without arguments if default arguments were provided in the constructor's definition.

[1] For example: When allocating memory dynamically, the constructor may be called by adding parenthesis after the class name.

Remember that each class can have at most one default constructor, either one without parameters, or one whose all parameters have default values, such as in this case: In C++, default constructors are significant because they are automatically invoked in certain circumstances; and therefore, in these circumstances, it is an error for a class to not have a default constructor: If a class has no explicitly defined constructors, the compiler will implicitly declare and define a default constructor for it.

Since neither the programmer nor the compiler has defined a default constructor, the creation of the objected pointed to by p leads to an error.

The default constructor implicitly calls the superclass's nullary constructor, then executes an empty body.