问题详情

答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关

有如下程序: Class Base{ publiC: int data; }; Class Derivedl:publiC Base{}; Class Derive


有如下程序: Class Base{ publiC: int data; }; Class Derivedl:publiC Base{}; Class Derived2:proteCted Base{}; int main() { Derivedl dl; Derived2 d2; dl.data=0;//① d2.data=0;//② retum 0; } 下列关于程序编译结果的描述中,正确的是()。

A.①②皆无编译错误

B.①有编译错误,②无编译错误

C.①无编译错误,②有编译错误

D.①②皆有编译错误

请帮忙给出正确答案和分析,谢谢!

参考答案
您可能感兴趣的试题