Physics, asked by shivaay8624, 1 year ago

How do we define a constructor when class name is x

Answers

Answered by KDRaika123
2
Constructors initialize values to object members after storage is allocated to the object. class A { into x; public: A(); //Constructor }; While defining a constructor you must remember that the name of constructor will be same as the name of the class, and constructors never have return type.
Similar questions