完成程序题:请按空格顺序填写答案。完成下面程序中的show函数的定义,使其运行结果如下:
In base
In derived
1/1 文字题
#include _________________
using namespace std;
class base
{
public :
virtual void print( )
{
cout << "In base" << endl;
}
};
class derived: public base
{
public :
void print( ) { cout << "In derived" << endl; }
};
void show(base * pb,void (base:: * pf) ( ) )
{
_________________
}
void main( )
{
base b;
derived d ;
show ( &b, base::print);
show ( &d, base::print);
}