有如下程序:
#include
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<
}
运行时的输出结果是
A.1
B.2
C.3
D.运行时出错
参考答案:C