首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #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
68
问题
有如下程序:
#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>voidmain(){inti=1;while(i<=8)if(++i%3!=2)continu
下列程序的运行结果为#include<iostream.h>Voidmain(){inta=2;ihtb=a+1;cout<<a/b<<end1;}
设有定义inta=1;floatf=1.2;charc=‘a’;,则下列表示错误的是
下列程序的运行结果是#include<iostream.h>classLocation{private:intX.Y;public:
如果表达式++x/y中,++是作为友元函数重载的,/是作为成员函数重载的,则该表达式还可为
以下对C++语言函数的有关描述中,正确的是
实现输出为八进制的符号是()。
C++语言中关键字运算符有new,delete和【】。
以下各选项组中,均是C++语言关键字的组是
随机试题
审美趣味中实际上存在着的矛盾包括
眼的调节主要包括
药师提供药学服务是为了提高药物治疗的()。
高质量的导游讲解服务可在一定程度上弥补旅行生活服务上的某些不足。()
实现表之间临时联系的命令是【】。
Theconceptionofpovertyandwhatto【C1】______aboutithavechangedoverthedecades.UnderSocialDarwinismthelazyandthe【C
Theprofessorsaysthatsuperhighways______.【30】
LearningEnglishis______attendingtheclassesandtakingnotes.
A、We’llhavenoneedtofindajob.B、We’lltalkandplaygameswithnoonebutthetools.C、We’llfeelboredinoursparetime.
Asthenewsalesdirectorforanationalcomputerfirm,AlexGordonwas【B1】______hisfirstmeetingwiththecompany’sdistrict
最新回复
(
0
)