基类指针保存派生类对象,基类指针只能访问基类里成员(7)
原创
©著作权归作者所有:来自51CTO博客作者XYG_XT的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:组合和继承综合(9)
下一篇:拷贝构造函数浅拷贝(10)
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
将派生类指针赋值给基类的指针
};A::A(int a):m_a(a) {}void A::display() {
c++ 开发语言 后端 派生类 赋值 -
基类和派生类
#inc
构造函数 派生类 #include