#include <iostream.h>
class Test
{int x,y;
public:
Test(int i,int j=0)
{x=i;y=j;}
int get(int i,int j)
{return i+j;}
};
void main()
{Test t1(2),t2(4,6);
int (Test::*p)(int,int=10);
p=Test::get;
cout<<(t1.*p)(5)<<endl;
Test *p1=&t2;
cout<<(p1->*p)(7,20)<<endl;
}
|