首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下类定义: 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
2021-09-05
18
问题
有如下类定义:
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://jikaoti.com/ti/nec0FFFM
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有如下程序段:inti=0,j=1;nt&r=i;//①r=j;//②int*p=&i;//③*p=&r;//④其中会产生编译错误的语句是()。
软件按功能可以分为:应用软件、系统软件和支撑软件(或工具软件)。下面属于应用软件的是()。
下列叙述中正确的是()。
下列选项可以做C++标识符的是()。
多继承的构造顺序可分为如下四步:①所有非虚基类的构造函数按照它们被继承的顺序构造②所有虚基类的构造函数按照它们被继承的顺序构造③所有子对象的构造函数按照它们声明的顺序构造④派生类自己的构造函数体这四个步骤的
有如下语句序列:ifstreaminfile("DATA.DAT");iffinfile.good())cout
数据库设计的四个阶段是:需求分析、概念设计、逻辑设计和()。
用树形结构表示实体之间联系的模型是()。
下列符号中,正确的C++标识符是()。
定义如下枚举类型enum{Monday,Tuesday,Wednesday,Thrusday,Friday=2};表达式Wednesday=Friday的值是()。
随机试题
男性,38岁。两下肢跛行4年,跛距800m,吸烟史15年,每日25支,体格检查两侧足背动脉搏动消失。最可能的诊断为
下列哪些是正确的?()
下列各项中,以单位犯罪论处的是()。
下列说法中,反映了职业道德特征的是()。
案例:下面是两位中学教师关于“酯化反应”的教学过程实录。【李老师的教学实录】【播放漫画】看漫画,喝醋能解酒。【讲述】台州人以豪爽著称,经常以酒会友,为什么喝醋能够解酒?【回答】酸跟醇作用生成酯。【讲述】同学们回答的很对,大家
所有重点大学的学生都是聪明的学生,有些聪明的学生喜欢逃课,小杨不喜欢逃课,所以小杨不是重点大学的学生。以下除哪项外,均与上述推理的形式类似?
第一本用马克思主义脱点阐述教育学和教育史的专著是()。
在表结构为(职工号,姓名,工资)的表Employee中查询职工号的左4位为"1962"的职工的最高工资值,正确的SQL命令是
下列对于软件测试的描述正确的是()。
HowtoApproachDiscursiveWritingHowtoimprovetheeffectivenessofstudents’writing?Therearesixstageswhichshouldbe
最新回复
(
0
)