转自 https://www.cnblogs.com/qyaizs/articles/2039101.html
在C中定义一个结构体类型要用typedef:
typedef struct Student
{
int a;
}Stu;
于是在声明变量的时候就可:Stu stu1;(如果没有typedef就必须用struct Student stu1;来声明)
这里的Stu实际上就是struct Student的别名。Stu==struct Student
另外这里也可以不写Student(于是也不能struct Student stu1;了,必须是Stu stu1;)
typedef struct
{
int a;
}Stu;
本文详细介绍了在C语言中如何使用typedef定义结构体类型的别名,并通过实例展示了如何简化结构体变量的声明过程。
1377

被折叠的 条评论
为什么被折叠?



