#include <iostream>
using namespace std;
typedef bool (*FUN)(void *,int);
class CParent
{
private:
int m_age;
public:
CParent()
{
m_age=30;
}
void Display(FUN cb,void *ptr,int count)
{
cb(ptr,count);
}
void Show()
{
Display(DisplayAge,this,2);
}
void ShowAge()
{
cout<<m_age<<endl;
}
static bool DisplayAge(void *ptr,int count)
{
CParent *pdata =static_cast<CParent*>(ptr);
pdata->ShowAge();
cout << count <<endl;
return true;
}
};
int main()
{
CParent father;
father.Show();
return 0;