首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include using namespace std; class Basel{ public: Basel(int d) {cout
有如下程序: #include using namespace std; class Basel{ public: Basel(int d) {cout
admin
2019-04-01
35
问题
有如下程序:
#include
using namespace std;
class Basel{
public:
Basel(int d) {cout<
----Basel(){)
};
class Base2{
public:
Base2(int d) {cout<
Base2(){}
};
class Derived:public Base l,Base2{
public:
Derived(int a,int b,int C,int d);
Base l(b),Base2(a),b l(d),b2(c){)
PriVate:
int bl;
intb2;
);
int main(){
Derived d(1,2,3,4);
return 0:
)
运行时的输出结果是( )。
选项
A、1234
B、2134
C、12
D、21
答案
D
解析
程序存创建派生类对象d时,分别调用基类Basel和Basel的构造函数。
转载请注明原文地址:https://kaotiyun.com/show/heAp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列选项中不符合良好程序设计风格的是
阅读以下程序#include<iostream.h>voidmain(){charline[10];in>>line;cout<<line<<endl;}如运行时输入Thisisane
以下程序的输出结果是()。#include<iostream.h>longfun(intn){longs;if(n==1||n==2)s=2;elses=n-fun(n-1);returns
下面描述中体现了抽象类特性的语句是
串的长度是
对于长度为n的线性表,在最坏情况下,下列各排序法所对应的比较次数中正确的是
数据流图中带有箭头的线段表示的是()
下列函数的功能是判断字符串str是否对称,对称则返回true,否则返回false。请在横线处填上适当内容,实现该函数。boolfun(char*str){inti=0,j=0;while(str[j])j++;
随机试题
健康的机构应具备的10个特点是什么?
LuXun’s________interestinmedicinewaslaterreplacedbythatinliterature.
抢救巴比妥类药物急性中毒时,不宜采取
患儿生后7d,在家接生,出现发热,烦躁不安,吸吮困难,苦笑面容,阵发性痉挛、惊厥,脐部发红。该患儿护理措施不正确的是()。
编制资产负债表时应该归类为流动资产的有()。
绩效考评的主体不包括()。
下列关于吸收直接投资筹资方式的表述中,不正确的是()。
下列对商品房现售条件的描述,正确的有()
Peoplethanktheirparentswithtwodays:Mother’sDay,onthesecondSundayinMay,andFather’sDay,onthethirdSundayin
A、Takeajobtopaythetuitionfees.B、Visithisparentsinhishometown.C、Spendthesummerwithhisfriends.D、Workasavolu
最新回复
(
0
)