首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #inelude using namespace std; class Basel{ public: Basel(int d) {cout
有如下程序: #inelude using namespace std; class Basel{ public: Basel(int d) {cout
admin
2015-09-14
72
问题
有如下程序:
#inelude
using namespace std;
class Basel{
public:
Basel(int d) {cout<
~Basel0{}
};
class Base2{
public:
Base2(int d) {cout<
~Base2 0{}
};
class Derived:public Base1,Base2{
public:
Derived(int a,int b,int C,int d);
Basel(b),Base2(a),bl(d),b2(c){}
Private:
int b1;
int b2;
};
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/KvNp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下面程序的运行结果是#include<iostream.h>classbase{protected:inta;public:base(){cout<<"0";}};
下列不是描述类的成员函数的是
下列程序是用来判断数组中特定元素的位置所在,则输出结果为#include<conio.h>#include<iostream.h>intfun(int*s,intt,int*k){i
已知程序的结果为123,请填空。#include<iostream.h>template<classT>classA{public:Tx,y,
以下不正确的定义语句是
以下程序段共有错误()处。#include<iostream>usingnamespacesstd;classSample{private:intn;public:
在所有排序方法中,关键字比较的次数与记录的初始排列次序无关的是()。
随机试题
流刑在中国古代有多个变种,即与一般流刑有所区别的特别流刑,下列选项中属于这类刑罚的有
医生通过观察、号脉能诊断出患者的病情。这属于下列哪种思维特征?()
制冷系统中的液体工质容器的安全装载量是其容积的()。
此时应考虑最可能的诊断为进一步处理不应是
下列关于我国仲裁制度的表述,符合《仲裁法》规定的是()。
国有制经济是我国社会主义经济制度的基础。()
红绿色盲是一种常见的遗传性疾病。在生活中可以发现,男性患者的人数远远多于女性患者。出现这种现象的原因是()。
通过拨号远程配置Cisco路由器时,应使用的接口是()。
Johnistheonlyoneofthestaffmemberswho______tobetransferred.
ElinorOstromisanAmericanpoliticalscientist.Shewas【B1】______the2009NobelMemorialPrizeinEconomicSciences,whichsh
最新回复
(
0
)