A constructor is a member function of a class that initializes objects of a class. In C++, Constructor is automatically called when an object (instance of a class) creates. It is a special member function of the class.
Syntax
class_name(parameter1, parameter2, ...)
{
// constructor Definition
}
Default Constructor
It is the constructor that doesn’t take any argument. It has no parameters.
Parameterized Constructors
It is possible to pass arguments to constructors. Typically, these arguments help initialize an object when it is created.
Copy Constructor
A copy constructor is a member function that initializes an object using another object of the same class.


