What is a constructor? | C++ Advanced | Part – 3
A Constructor is a function with the same name as the class. class Heyconstructor{ Heyconstructor(){ //Constructor //statements } } In the above snippet Heyconstructor() is a constructor which has the same name as the class. Every time if any object of above class is created, the constructor is by default called. A constructor is used to provide initial values to the …
What is a constructor? | C++ Advanced | Part – 3 Read More »