在 C++ 中,class 和 struct 其实没有太大区别。唯一的区别点在于,struct 中的成员默认为 public,而 class 默认为 private。
也就是说,struct可作为一种特殊的class而存在。