该文只是对以下原文中C++部分单独进行了归纳,原文地址:https://blog.csdn.net/shanshanhi/article/details/52268167
typedef是类型定义的意思
(1)struct Student
struct Student{
int a;
}stu1; //stu1是结构体变量
使用时只需通过stu1就可调用结构体的成员变量。
eg:stu1.a;,就可以调用结构体成员中的变量a。
(2)typedef struct Student
typedef struct Student{
int a;
}stu2; //stu2是一个结构体类型名
eg:但在这里必须先stu2 s2; //先要定义一个变量
然后s2 a; //通过变量调用结构体的成员