第23839题 单选题
判断给定C++继承类代码中哪行会引起编译错误

给定如下C++代码:

#include <iostream>
using namespace std;

class Base {
private:
    int a;
protected:
    int b;
public:
    int c;
    Base() : a(1), b(2), c(3) {}
};

class Derived : public Base {
public:
    void show() {
        cout << a << endl;   // Line 1
        cout << b << endl;   // Line 2
        cout << c << endl;   // Line 3
    }
};

( )行代码会引起编译错误。

{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析