using Constructors in Classes




This video tutorial explains the constructors in c++.
You are gonna learn what is a constructor, how to define a constructor, how to use constructors in your program, what is the relationship between constructor, class and object in detail with examples.

source code for this tutorial

#include 
#include 

using namespace std;

class Human{
private:
        string name;
        int age;

public:
    Human(){
        name = "nonane";
        age = 0;
        cout << "constructor is called when u create an object of human"<
                  
Back To Top