若有定义classA{intx,y;staticfloatf(inta){}floatg(intx1,intx2){}}及A a1=newA();则下列用法中合法的是()。 A.g(3,2)B.a1.g(2,5)C.a1.f(4)D.f(3)

若有定义classA{intx,y;staticfloatf(inta){}floatg(intx1,intx2){}}及A a1=newA();则下列用法中合法的是()。

A.g(3,2)

B.a1.g(2,5)

C.a1.f(4)

D.f(3)


相关考题:

若有以下程序:include using namespaces std;class A{public: A (){} A (int i) {x1= 若有以下程序: #include <iostream> using namespaces std; class A { public: A (){} A (int i) { x1=i; } void dispa() { cout<<"xl="<<xl<<" , "; } private: int x1; }; class B : public A { public: B (){} B (int i):A(i+10) { x2=i; } void dispb() { dispa (); cout <<"x2="<<x2<<end1; } private: int x2; }; int main () { B b(2); b.dispb (): return 0; } 程序运行后的输出结果是( )。A.x1=10,x2=2B.x1=12,x2=10C.x1=12,x2=2D.x1=2,x2=2

请找出下列程序中错误之处 ______。 include classA{private: intx1;protected: int 请找出下列程序中错误之处 ______。#include<iostream.h>class A{private:int x1;protected:int x2;public:int x3;};class B:public A{private:int y1;protected:int y2;public:int y3;void disp(){cout<<x1<<y1<<end1:} //Avoid set(int i) {x2=i;} //B};void main() {B bb;bb.x3=10; //Cbb.y3=10; //D}A.AB.BC.CD.D

若有以下程序:includeusing namespaces std;class A{public: A(){} A(int i) {xl=i; 若有以下程序: #include<iostream> using namespaces std; class A { public: A(){} A(int i) { xl=i; } void dispa() { cout<<"x1="<<x1<<","; } private: int x1; }; class B:public A { public: B(){} B(int i):A(i+10) { x2=i; } void dispb() { dispa(); cout<<"x2="<<x2<<endl; } private: int x2; }; int main{) { B b(2); b.dispb(): return 0; } 程序运行后的输出结果是A.x1=10,x2=2B.x1=12,x2=10C.x1=12,x2=2D.x1=2,x2=2

若有以下程序:includeusing namespaces std;class A{public:A(){}A(int i){x1=i; } v 若有以下程序: #include<iOStream> using namespaces std; class A { public: A(){} A(int i) { x1=i; } void dispa() { cout<<"X1="<<x1<<",": } private; int x1; }; class B:public A { public: B(){} B(int i):A(i+10) { x2=i; } void dispb() { dispa(); cout<<"x2="<<x2<<end1; } private: int x2; }; . int main() { B b(2); b.dispb() return 0; } 程序运行后的输出结果是( )。A.x1=10,x2=2B.x1=12,x2=10C.x1=12,x2=2D.x1=2,x2=2

若有以下程序:include using namespaces std;class A {public: A(){} A(int i) {x1=i 若有以下程序: #include <iostream> using namespaces std; class A { public: A(){} A(int i) { x1=i; } void dispa() { cout<<'x1="<<x1<<","; } private: int x1; }; class B: public A { public: B(){} B(int i):A(i+10) { x2=i; } void dispb() { dispa(); cout<<"x2="<<x2<<end1; } private: int x2; }; int main() { B b(2); b.dispb(): return 0; } 程序运行后的输出结果是A.x1=10,x2=2B.x1=12,x2=10C.x1=12,x2=2D.x1=2,x2=2

若有定义:int a[5],*p;,则操作p=a;是合法的操作。

正确定义了全局变量a=3,b=4;执行下列程序 void fun(int x1,int x2) {printf("%d,%dn",x1+x2,b);} main() {int a=5,b=6;fun(a,b);} 后输出的结果是 ?A.3,4 B.11,4 C.11,1 D.11,6

2、下面的函数调用语句中含有()个实参  int a,b,c;  int sum(int x1,int x2);  ……  total=sum((a,b),c);A.2B.3C.4D.5

【单选题】在创建数组时,下列创建的方法中合法的是()。A.int a[ ] [ ]=new a[10][5]B.int a[]=new int[10 ]C.int [ ]a=new a[10 ]D.int a[]=new a[10 ]