已知枚举类型声明语句为: enum COl,OR{WHITE,YELLOW,GREEN=5,RED,BLACK=10}; 则下列说法中错误的是( )。
A. 枚举常量YELLOW的值为1
B. 枚举常量RED的值为6
C. 枚举常量BLACK的值为10
D. 枚举常量WHITE的值为1
有如下类定义: class MyClass {public: private: ______________________________________int data; }; 若要为MyClass类重载流输入运算符“>>”,使得程序中可以“cin>>obj;”的形式改变MyClass类的对象0bj中数据成员data的值,则横线处的声明语句应为( )。
A. friend istream& operator>>(istream&is,MyClass&A.;
B. friend istream&operator>>(istream&is,MyClass A.;
C. istream&operator>>(istream&is,MyClass&A.;
D. istream&operator>>(istream&is,MyClass A.;
有如下头变件: int f1()StatiCintf2( ); Class MApubliC: intf3(); 1statiC int f4(); }; 在所描述的函数中,具有隐含的this指针的是( )。
A. f1
B. f2
C. B
D. f4
有如下程序: #inClude using namespaCe std; Class MusiC{publiC: void setTitle(Char*str){strCpy(title,str);} proteCted: Char type[10]; private: Char title[20]; Class Jazz:publiC MusiC{ publiC: void set(Char*str){strCpy(type,”Jazz’’);//① strCpy(title,str);//②} }; 下列叙述中正确的是( )。
A. 程序编译正确
B. 程序编译时语句①出错
C. 程序编译时语句②出错
D. 程序编译时语句①和②都出错