题目内容:
有如下程序: 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.①②皆有编译错误
参考答案:
答案解析: