首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下类定义: class Point{ public: void SetX(int xx) { x=xx; } void SetY(int yy) { y=yy; }
有如下类定义: class Point{ public: void SetX(int xx) { x=xx; } void SetY(int yy) { y=yy; }
admin
2015-07-22
1.2K+
问题
有如下类定义:
class Point{
public:
void SetX(int xx) { x=xx; }
void SetY(int yy) { y=yy; }
private:
int x,y;
};
class Circle:public Point{
public:
int GetRadius() { return radius; }
private:
void SetRadius(int r) { radius=r; }
int radius;
friend void show();
};
在派生类 Circle 中函数show()可访问的成员的个数为
选项
A、1
B、3
C、5
D、7
答案
C
解析
本题考查派生类对基类成员的访问属性,派生类公用继承基类,基类的私有成员不可访问,派生类的友元函数可以访问本类的所以成员以及基类的公用成员,所以可以访问的成员为5个,其中基类2个,本类中3个,所以C选项正确。
转载请注明原文地址:https://kaotiyun.com/show/juNp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有如下程序段:for(inti=1;i
有如下程序:#includeusingnarnespacestd;classONE{inte;public:ONE():c(O){cout
数据库系统阶段的数据具有较高独立性,数据独立性包括物理独立性和【】两个含义。
面向对象程序设计将数据与()放在一起,作为一个相互依存、不可分割的整体来处理。
关于动态存储分配,下列说法正确的是______。
结构化程序设计所规定的三种基本控制结构是()。
关于continue语句叙述不正确的是
进行文件操作需包含的头文件是()。
下面的叙述中,不符合赋值兼容规则的是()。
算法的空间复杂度是指()。
随机试题
以下几项中,属于外来原始凭证的是
函数G(x)=t2etdt,求G’(x).
关于新生儿用药特点叙述正确的是
1.简述流水施工的主要特点。2.某一段公路水泥稳定粒料基层的设计厚度为20cm,待评定路段的厚度检测值为(单位:em):21、22、20、19、19、20、21、21、22、19。试评定其厚度是否满足要求。(已知:厚度平均值容许偏差为-8mm,极差为
根据《企业会计准则第28号——会计政策、会计估计变更和差错更正》的规定,下列各项会计处理中,正确的有()。
下列关于《水经注》的介绍,正确的选项是()。
19世纪70年代宁波买办严信原创办轧花厂,因惧怕官吏们反对,所以表面上依附于日本人的保护之下;上海均昌机器厂造的一艘小汽船,船头悬挂英国旗,船尾悬挂中国龙旗。对上述材料所反映的现象理解正确的是()。
公文用纸的幅面尺寸一般是()。
Whenconfrontedwithsuchquestion,mymindgoes______,andIcanhardlyremembermyownbirthday.
USWhiteHousespokesmanTonySnowoncesentjournalistsdiggingfortheirdictionaries.Hecalledrecentcriticismbytheforme
最新回复
(
0
)