Object Oriented Programming208010 marksConstructor definition and purpose
What is constructor? Explain its types with suitable example.How is the constructor called in a derived class in C++?[6+4]
What is constructor? Explain its types with suitable example.How is the constructor called in a derived class in C++?[6+4]
A constructor is a special member function of a class that is automatically called when an object of that class is created. It is used to initialize the data members of the class. - Has the same name as the class - Has no return type (not even void) - Called automatically when an object is create...