2078 6

CSC166 ยท 2078 ยท 5 marks

What is constructor? Explain the concept of default and default copy with suitable example.

What is constructor? Explain the concept of default and default copy with suitable example. [5]

Object Oriented ProgrammingChapter 3: Classes & ObjectsDefault Constructor

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. Key characteristics: - Has the same name as the class - Has no return type (not even void) - Called automatically at ...