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

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

问题描述

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

Can a struct be inherited in C++?

推荐答案

是的,structclass 完全一样,只是默认的可访问性是 public> 用于 struct(而 private 用于 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天全站免登陆