C語言--typedef struct與struct定義結構體的區別

我在不少C語言代碼中看到不少定義結構體時使用typedef struct,而不適用struct,就瞭解了這樣作的緣由:node typedef是類型定義的意思。typedef struct 是爲了使用這個結構體方便。 具體區別在於: (1)若struct node {}這樣來定義結構體的話。在申請node 的變量時,須要這樣寫,struct node n; (2)若用typedef,能夠這樣寫,t
相關文章
相關標籤/搜索