在c ++中的结构继承 [英] Struct inheritance in c++

查看:134
本文介绍了在c ++中的结构继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在C ++中继承 struct 吗?

Can a struct be inherited in C++?

推荐答案

是, struct 完全类似于 class ,除非默认辅助功能是 public struct (而 private for class )。

Yes, struct is exactly like class except the default accessibility is public for struct (while it's private for class).

这篇关于在c ++中的结构继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆