有如下的对类“CSample”的定义,其中()在语法上是错误的。 class CSample { int a=51; // CSample(); // public: CSample(int val); // ~ CSample(); // }; ......
A.int a=51;
B.CSample();
C.CSample(int val);
D.~ CSample();
- · 有4位网友选择 C,占比40%
- · 有3位网友选择 B,占比30%
- · 有3位网友选择 A,占比30%
A.int a=51;
B.CSample();
C.CSample(int val);
D.~ CSample();
下述程序中语句完全不正确的一组语句是() class automover { int wheels; float weight; public: void initialize(int, float); int get_wheels(); float get_weight(){return weight;} }; void automover::initialize(int in_wheels, float in_weight) { wheels=in_wheels; weight=in_weight;} int automover::get_wheels(void){ return wheels; } void main() { automover car; automover.initialize(4, 3000.0); //① car.wheels=4; //② car.weight=3000.0; //③ car.initialize(4, 3000.0); //④ cout<<"\nthe car has> <<" wheels."; ⑤ car weighs> <<" pounds."; ⑥ car has> <<" wheels."; ⑦ car weighs> <<" pounds."; ⑧ }> A、①、②、③、④、⑤
B、①、②、③、⑤、⑥
C、②、③、④、⑤、⑥
D、①、②、④、⑦、⑧
A、D d(10);
B、B *pb=&d;
C、B b(5);
D、pb->Print();
A、有语义二义性;
B、使用 Params 参数!使用两个整型参数!使用 Params 参数!
C、使用 Params 参数!使用 Params 参数!使用 Params 参数!
D、使用 Params 参数!使用两个整型参数!使用两个整型参数!
classMyClass{
public:
voidfunctionl(MyClass&c){out$amp;statievoidfunction2(MyClas&c){cout$amp;voidfunction3(){out$amp;statiCvoidfunction4(){COut$amp;private:
intdata;
}:
其中有编译错误的函数是()。
A.function1
B.function2
C.function3
D.function4
A、x = 5;
B、y = 5;
C、z = 5;
D、ShowA( );
A、pb=b[5];
B、*pb=b;
C、pb=*b;
D、*bp=&b[5];
E、pb=b;
F、pb=&b[5];
G、pb=new int;
H、pb=new int(5);
I、pb=new int[5];
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!