有如下类定义: class Base{ public: int a; protected: int b; private: int c; }; class Derived:

admin2015-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
0

随机试题
最新回复(0)