完成下面程序中的show函数的定义,使其运行结果如下:
Inbase
Inderived
程序清单如下:
#include
usingnamespacestd;
classbase
{
pubhc:
virtualvoidprint()
{
cout<<"Inbase"<}
};
classderived:publicbase
{
public:
voidprint(){cout<<"Inderived"<};
voidshow(base*pb,void(base::*pf)())
{
_________
}
voidmain()
{
baseb;
derivedd;
show(&b,base::print);
show(&d,base::print);
}