C++类Struct


Student.h


main.cpp

struct 构造类,如果改为class就报错。
public与private

[参考链接]([C++ class和struct区别-C++类与结构体区别-嗨客网 (haicoder.net)](https://m.haicoder.net/cpp/cpp-class-struct.html#:~:text=C%2B%2B 中的 struct 可以包含成员函数,也能继承,也可以实现多态。 但在 C%2B%2B 中,使用 class,class 继承默认是 private 继承,而 struct 继承默认是 public 继承。))

原文地址:https://www.cnblogs.com/Todd-Qi/p/15085038.html