black

登录

单项选择题

有如下程序:
  #include <iostream>
  using namespace std;
  class Toy{
  public:
  Toy(char* _n) { strcpy (name,_n); count++;}
  ~Toy(){ count--; }
  char* GetName(){ return name; }
  static int getCount(){ return count; }
  private:
  char name[10];
  static int count;
  };
  int Toy::count=0;
  int mail(){
  Toy t1(“Snoopy”),t2(“Mickey”),t3(“Barbie”);
  cout<  return 0;
  }
  运行时的输出结果是

A.1
B.2
C.3
D.运行时出错

相关考题

单项选择题 有如下类定义   class A {   char *a;   public:   A():a(0){}   A(char *aa){ //把aa所指字符串拷贝到a所指向的存储空间   a= ;   strcpy(a,aa);   strcpy(a,aa);   }   ~A() {delete []a;}   };   横线处应填写的表达式是

单项选择题 有如下程序:   #include   #include   Using namespace std;   int main(){   int s[]={123, 234};   cout<  for(int i=0; i<2; i++) { cout<  return 0;   }   运行时的输出结果是()

单项选择题 有如下程序:   #include<iostream>   using namespace std;   class C1{   public:   ~C1(){ cout<<1; }   };   Class C2: public c1{   public:   ~c2(){ cout<<2; }   };   int main(){   C2 cb2;   C1 *cb1;   return 0;   }   运行时的输出结果是

All Rights Reserved 版权所有©PP题库网库(pptiku.com)

备案号:湘ICP备14005140号-5

经营许可证号:湘B2-20140064