Thursday, 20 July 2017

program of class using constructor and destructor

#include<iostream.h>
#include<conio.h>
class abc
{
int x;
float y;
public:
abc()
{
cout<<"construtor\n";
}
~abc()
{
cout<<"object destroyed\n";
}
};
void main()
{
clrscr();
abc x1;
getch();
}

No comments:

Post a Comment