Advertisements
Advertisements
Question
What is a constructor?
Short Answer
Solution
- A constructor is a special member function of a class. Its task is to initialize the objects of its class.
- It is special because its name is the same as that of the class to which it belongs.
shaalaa.com
Is there an error in this question or solution?