以下はサンプルコードであり、動作するものではありません。Cのポインターの*head
との違いを知りたいだけです。(*head)
int insert(struct node **head, int data) {
if(*head == NULL) {
*head = malloc(sizeof(struct node));
// what is the difference between (*head)->next and *head->next ?
(*head)->next = NULL;
(*head)->data = data;
}