using Distructors in Classes




This video tutorial explains the usage of distructors in c++.
You are gonna learn what is a distructor, how to use distructors in a class, what is the syntax to declare or define distructors, what is the use of distructors in detail with example.

source code for this tutorial

#include <iostream>

using namespace std;

class Human{
public:
    Human(){
    cout << "constructer called"<<endl;
    }

    ~Human(){
        cout << "destructer called"<<endl;
    }

};


int main()
{
    Human *anil;
    anil = new Human();
    delete anil;
    return 0;
}

 
Back To Top