综合百科

C语言typedef struct的用法

在c中定义一个结构体类型用typedef:

typedef struct Student

{

int m;

}Stu;

用这种形式定义的时候,在声明结构体变量的时候可用:Stu stu1; 这种形式也等同于struct Strdent stu1;

这里的Stu和struct Student等同,Stu也就相当于struct Student的另一个名字。