填空题

有如下程序:
  #include <iostream>
  using namespace std;
  class GrandChild{
  public:
  GrandChild(){ strcpy (name,”Unknown”); }
  const char * getName()const { return name; }
  virtual char * getAddress()const=0;
  private:
  char name[20];
  };
  class GrandSon : public GrandChild{
  public:
  GrandSon{char *name} {}
  Char * getAddress() const { return “Shanghai”; }
  };
  int main(){
  GrandChild *gs=new GrandSon(“Feifei”);
  cout<getName()<<”住在”<getAddress()<  delete gs;
  return 0;
  }
  运行时的输出结果是 【13】

【参考答案】

Unknown住在Shanghai