constructor and destructor in cpp

#include <iostream>
using namespace std;
class cons
{
public:
cons()
{
cout << "Constructor called " << endl;
}
~cons()
{
cout << "destructor is called" << endl;
}
};
int main()
{
system("cls");
cout<<"Code with Khushpreet\n";
cons obj;
}
view raw Constructor hosted with ❤ by GitHub

Post a Comment

If you have furthur QUERIES please let us know

Previous Post Next Post