A constructor with no parameters is called a default constructor. A default constructor has every instance of the class to be initialized to the same values. The default constructor initializes all numeric fields to zero and all string and object fields to null inside a class .
Read moreDo you need a default constructor in C++?
Answer: C++ Empty constructor necessity depends upon class design requirements . We know that C++ class constructor is called when we create an object of a class. If a class is not required to initialize its data member or does not contain data member, there is no need to write empty constructor explicitly.
Read moreDoes C++ automatically create constructors?
In C++, the compiler automatically generates the default constructor , copy constructor, copy-assignment operator, and destructor for a type if it does not declare its own. These functions are known as the special member functions, and they are what make simple user-defined types in C++ behave like structures do in C.
Read more