प्रोग्राम- डिस्ट्रक्टर फंक्शन
#include<iostream>
using namespace std;
class sample
{
sample () // Construtor
{
cout<<"Object created\n";
}
~sample () //Destructor
{
cout<< "Object destroyed";
}
};
int main ().
{
sample s;
return 0;
}
प्रोग्राम का आउटपुट होगा
Object created
Object destroyed