首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下类定义: class Base{ public: int a; protected: int b; private: int c; }; class Derived:
有如下类定义: class Base{ public: int a; protected: int b; private: int c; }; class Derived:
admin
2015-07-22
23
问题
有如下类定义:
class Base{
public: int a;
protected: int b;
private: int c;
};
class Derived: public Base {
protected: int d;
friend void show();
};
在类 Derived 中,函数 show() 不能直接访问的数据成员是
选项
A、a
B、b
C、c
D、d
答案
C
解析
本题考查友元函数,本题中定义的show不能直接访问Base里的私有成员。
转载请注明原文地址:https://kaotiyun.com/show/WMNp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
以下哪个特征不是面向对象思想中的主要特征?
当循环队列非空且队尾指针等于队头指针时,说明循环队列已满,不能进行入队运算。这种情况称为【】。
#include<iostream.h> voidmain() {intn=9; while(n>6){n--; cout<<n;}} 该程序的输出结果是
将代数式转换成程序设计中的表达式为【】。
编译时的多态性可以通过使用()获得。
下面程序的执行结果为 #include"iostream" usingnamespacestd; classA { inta; public: voidSeta(intx){a=x;} void
对于下面定义的类MyClass,在函数f()中将对象成员n的值修改为50的语句应该是()。classMyClass{public:MyClass(intX){n:x;}voidSetNum(intn1
算法的时间复杂度是指【】。
类模板的模板参数()。
已知:intn=10;那么下列语句中错误的是
随机试题
在美国,头颈部恶性肿瘤发病人数占全身恶性肿瘤的百分比大约是
《刑法》第二百三十八条第一款与第二款分别规定:“非法拘禁他人或者以其他方法非法剥夺他人人身自由的,处三年以下有期徒刑、拘役、管制或者剥夺政治权利。具有殴打、侮辱情节的,从重处罚。”“犯前款罪,致人重伤的,处三年以上十年以下有期徒刑;致人死亡的,处十年以上有
实行两级核算的施工企业,一般在()计算工程成本。
保险公估从业人员要忠诚于所属公估机构的利益,严守秘密,下列关于保密原则的说法中,正确的是( )。
安全附件按其功能可分为()。
2015年12月3日,刘某到甲公司工作,12月10日双方订立了书面劳动合同,合同约定:合同期限2年(含试用期期限),试用期2个月;试用期月工资4500元,试用期满月工资6000元;试用期内刘某若被证明不符合录用条件,甲公司可随时通知其解除劳动合同。
马克思、恩格斯论证了无产阶级要实现历史赋予它们的伟大使命,必须通过()。
依次填入下面一段文字横线处的语句,衔接最恰当的一项是()。在我国古代,人们盛物用的器皿除陶器等之外,还有一种容器,是葫芦。_________,_________。_________。_________。_________。________
A=WashingtonD.C.B=NewYorkCityC=ChicagoD=LosAngelesWhichcity...istheheadquarteroftheSupremeCourt?
Dutchtreatisalate-nineteenth-centuryterm,anditoriginallyreferstoadinnerwhereeveryoneisexpectedtopayforhisow
最新回复
(
0
)