首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下类定义: class Base{ int l; public: int m; private: int n; }; class Derived:
有如下类定义: class Base{ int l; public: int m; private: int n; }; class Derived:
admin
2020-06-29
40
问题
有如下类定义:
class Base{
int l;
public:
int m;
private:
int n;
};
class Derived: public Base{};
则类 Derived 所拥有的数据成员的个数是
选项
A、0
B、1
C、2
D、3
答案
D
解析
C++中派生类拥有基类的所有成员,所以Derived类中数据成员分别是:l、m、n,答案为D。
转载请注明原文地址:https://www.kaotiyun.com/show/4Z8p777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
一个C++语言程序的开发步骤通常包括编辑、【】、链接、运行和调试。
考虑下面的函数原型;voidf(inta,intb=7,charc=’@’);下面的函数调用中,不合法的是()。
下列字符串中,正确的C++标识符是
有如下程序段:inti=0,j=1;int&r=i;∥@r=j;∥②int*p=&i;∥③*p=&r;∥④其中会产生编译错误的语句是()。
有如下的运算符重载函数定义:doubleoperator+(inti,intk){returndouble(i+k);}但定义有错误,对这个错误最准确的描述是()。
下列运算符中,不能被重载的是()。
下面描述中不属于软件需求分析阶段任务的是
数据库应用系统中的核心问题是( )。
字符串"8+a=\tb\n\r"的长度为
在软件开发中,需求分析阶段产生的主要文档是( )。
随机试题
(76)Withinafewshortyears,girlsinEuropehavebecomeheaviersmokersthanboys,forreasonsexpertsstillfailtounderstan
A.亚铁盐B.氨苯蝶啶C.溴化钾D.巴比妥E.地高辛不宜与安宫牛黄丸合用的药物是
混悬剂的物理稳定性因素不包括()
一个基层预算单位开设一个零余额账户。()
甲、乙、丙、丁拟设立一个有限合伙企业,合伙协议中约定了如下内容,其中符合合伙企业法律制度规定的有()。
通过伪造某台主机的IP地址窃取特权的攻击方式属于()。
数据库管理系统是()。
Readthetextbelowabouthowtoorderproducts.Inmostofthelines41-52thereisoneextraword.Itiseithergrammatically
Sevenyearsago,whenIwasvisitingGermany,Imetwithanofficialwhoexplainedtomethatthecountryhadaperfectsolution
Thewaypeopleholdtothebeliefthatafun-filled,painfreelifeequalshappinessactuallyreducestheirchancesofever【B1】
最新回复
(
0
)