访问修饰符 public.protected.private,无论是修饰类内成员(变量.函数),还是修饰继承方式,本质上实现的都是可见性的控制. Difference between private, public, and protected inheritance class A { public: int x; protected: int y; private: int z; }; class B : public A { // x is public // y is protected…