若有以下程序: #include <iostream> using namespace std; class Base { public: void who(){ cout<<"Base"<<end1;} }; class Derivedl: publi

admin2013-02-27  58

问题 若有以下程序:
#include <iostream>
using namespace std;
class Base
{
public:
void who(){ cout<<"Base"<<end1;}
};
class Derivedl: public Base
{
public:
void who() { cout<<"Derived"<<end1; }
};
int main()
{
  Base *p;
  Derived1 obj1;
  p=&obj1;
  p->who();
  return 0;
}
则该程序运行后的输出结果是【  】。

选项

答案Derived

解析
转载请注明原文地址:https://jikaoti.com/ti/1eE0FFFM
0

最新回复(0)