Thursday, 20 July 2017

destructor

#include<iostream.h>
#include<conio.h>
class test
{
int x;
float y;
public:
test(int a,int b)
{
cout<<"construtor\n";
x=a;
y=b;
cout<<x<<y<<"\n";

}
~test()
{
cout<<"object destroyed\n";
}
};
void main()
{
//clrscr();
test t1(10,20);
getch();
}

No comments:

Post a Comment