class base{
public:void pub_mem();
protected: int prot_mem;
private: char priv_mem;
};
struct Pub_Derv : public Base{
int f() { return prot_mem; }
char g() { return priv_mem; }
};
struct Priv_Derv : private Base{
int f1() const { return prot_mem; }
};
类继承的示例
于 2020-05-18 11:45:45 首次发布