轉https://blog.csdn.net/qq_41848006/article/details/81321883
node 結點
typedef 是類型定義的意思 typedef struct 是為了使用這個結構體方便.
區別在於 : 若struct node{}這樣來定義結構體變量時,需要:
struct node n;
若用typedef :
typedef struct node{}NODE
在申請變量時就可以 : NODE n;
其實就相當於 NODE是node的別名,區別在於是否可以使用struct這個關鍵字
eg1: //在c中定義一個結構體類型時如果要用到typedef
typedef struct Student
{
int no;
char name[12];
}Stu,student;
在聲明變量時就可,Stu stu1;或者 student stu2;(Stu 和 student同時為Student的別名)
無typedef::
struct Student
{
int no;
char name[12];
}Stu;
則必須用struct Student stu1;或者struct Stu stu1;來聲明