#include<iostream>
using namespace std;
class box
{
public:
box(int h=10,int w=11);
~box(){cout<<"hello"<<endl;}
int height;
int wight;
int volume();
};
box::box(int h,int w)
{
height=h;
wight=w;
}
int box::volume()
{
cout<<height*wight<<endl;
return 0;
}
int main()
{
box a(1,12);
int *p=&a.height;
cout<<*p<<endl;
box *p1=&a;
p1->volume();
int (box::*p2)();
p2=&box::volume;
(a.*p2)();
return 0;
}
using namespace std;
class box
{
public:
box(int h=10,int w=11);
~box(){cout<<"hello"<<endl;}
int height;
int wight;
int volume();
};
box::box(int h,int w)
{
height=h;
wight=w;
}
int box::volume()
{
cout<<height*wight<<endl;
return 0;
}
int main()
{
box a(1,12);
int *p=&a.height;
cout<<*p<<endl;
box *p1=&a;
p1->volume();
int (box::*p2)();
p2=&box::volume;
(a.*p2)();
return 0;
}