我學習如何在C中創建鏈接列表。請看this article。數據類型* <變量名稱>與數據類型* <變量名稱>之間的區別
首先,他使用以下代碼創建結構;
struct node
{
int data;
struct node *next;
};
其明確說明* next是類型節點的指針變量。
但是當他前進時,他這樣做;
struct node* head = NULL;
struct node* second = NULL;
struct node* third = NULL;
現在,在這裏我有一個問題,理解他正在嘗試做什麼;他是在創建名稱,頭部,第二和第三個節點嗎?或者他只是試圖創建類型節點的指針變量?
因爲他把它們等於NULL;我假設他正在嘗試創建指針變量。但是他不能用這個做同樣的事嗎?
struct node *head = NULL;
struct node *second = NULL;
struct node *third = NULL;
由於
那麼'struct node * head'和struct node'struct node * head'之間的區別呢? – 2014-09-20 21:56:24
'a = a + b'和'a = a + b'有什麼區別? – dari 2014-09-20 21:56:28
'struct node * head'和'struct node * head'和'struct node * head'和'struct node * head'沒有區別。 – 2014-09-20 21:56:37