有如下类定义和变量定义:class parents{public:int publicData;private:int privateData;};class
15 查阅
有如下类定义和变量定义:
class parents{
public:
int publicData;
private:
int privateData;
};
class ChildA:public Parents{/*类体略*/);
class ChildB:private Parents{/*类体略*/};
ChildA a;
ChildB b:
下列语句中正确的是
A.cout<<a.pubficData<<endl;
B.cout<<a.privateData<<endl;
C.cout<<b.pubficData<<endl;
D.cout<<b.privateData<<endl;
参考答案: