c++

What is a constructor

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 »

what is class

What is a Class? | C++ Advanced | Part – 2

What comes first in your mind when we think about class? The above image? Yeah? Let’s consider class is a group of girls and boys managed by a teacher. Classes in C++ are data members and member functions bunched together. Data members are nothing but the variables declared inside a class. And, member functions are the functions that are used to access and manipulate these

What is a Class? | C++ Advanced | Part – 2 Read More »