C++中的结构继承

2021-12-17 00:00:00 inheritance struct 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).

相关文章