单项选择题
应在下面程序下划线中填写的正确的语句是( )。
#include <iostream>
using namespace std;
class A
public:
void test()cout<< "this is A!";
;
class B:public A
void test()
______ //显示调用基类函数test()
cout<< "this is B!";
;
void main()
A.A::test()
B.test()
C.B::test()
D.this->test()
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
下面程序输出的结果是( )。 #include<iostream> using namespace std; int test(int n1,int n2) return n1 +n2; float test (int f1,float f2)return f1-f2; float test(float x,float y)return(x+y) 2; float test(float x,int y)return(x+y)*2; void main() int a1=10; float a2=2.5f; cout<<test(a1,a2);
A.12.5
B.7.5
C.6.25
D.25
点击查看答案&解析
单项选择题
下面程序输出的结果是( )。 #include<iostream> using namespace std; class A int X; public: A(int x):x(++x) ~A()cout<<x; ; class B:public A int y; public: B(int y):A(y),y(y) ~B()cout<<y;; ; void main() B b(3);
A.34
B.43
C.33
D.44
点击查看答案&解析
相关试题
下面程序执行的结果是 【14】 #includ...
下面程序执行的结果是 【15】 。 #in...
虚基类是含有 【13】 函数的类。
面向对象的基本特点包括继承性、封装性和 ...
C++源程序中,只有 【12】 个主函数。