A.g(3,2)
B.a1.g(2,5)
C.a1.f(4)
D.f(3)
第1题:
若有以下程序: #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=2
B.x1=12,x2=10
C.x1=12,x2=2
D.x1=2,x2=2
第2题:
正确定义了全局变量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
第3题:
【单选题】在创建数组时,下列创建的方法中合法的是()。
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 ]
第4题:
若有定义:int a[5],*p;,则操作p=a;是合法的操作。
第5题:
2、下面的函数调用语句中含有()个实参 int a,b,c; int sum(int x1,int x2); …… total=sum((a,b),c);
A.2
B.3
C.4
D.5