.. _ch11-xt4: 习题4 ================ 这里咧威将给出详细的代码吧 .. code-block:: c++ #include #include using namespace std; class Student { public: void get_value() { cin >> num >> name >> sex; } void display(); protected: //这里改成保护的,这样在派生类中就可以直接引用这些数据了 int num; string name; char sex; }; void Student::display() { cout<<"num: "<> age >> addr; } void Student1::display_1() { //不需要使用基类的输出函数, 在main函数中直接调用 cout << "age:" << age << endl; cout << "address:" << addr <