Constructors and Destructors in C++
Constructor
A constructor is a special member function of a class that is automatically called when an object of that class is created.
Its main purpose is to initialize objects.
Constructors have the same name as the class and do not have a return type.
Types of Constructors:
Default Constructor:
Takes no parameters.