black

登录

单项选择题

有如下程序:
  #include<iostream>
  using namespace std;
  class Name{
  char name[20];
  public:
  Name(){
  strcpy(name,””); cout<<’’;
  }
  Name(char *fname)){
  strcpy(name,fname); cout<’’;
  }
  };
  int main(){
  Name names[3]={Name(“张三”),Name(“李四”)};
  Return 0;
  }
  运行此程序输出符号?的个数是

A.0
B.1
C.2
D.3

相关考题

单项选择题 有如下程序:   #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;   }   运行时的输出结果是

单项选择题 有如下类定义   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;   }   运行时的输出结果是()

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

备案号:湘ICP备14005140号-5

经营许可证号:湘B2-20140064