struct node
14
{
15
int data;
16
struct node* next;
17
};
18
19
/* 反转单链表. 分别用3个指针,指向前一个,当前,下一个 /
20
static void reverse(struct node* head_ref)
21
{
22
struct node* prev = NULL;
23
struct node* current = head_ref;
24
struct node next;
25
while (current != NULL)
26
{
27
next = current->next;
28
current->next = prev;
29
prev = current;
30
current = next;
31
}
32
head_ref = prev;
33
}
oid printList(struct node *head)
48
{
49
struct node *temp = head;
50
while(temp != NULL)
51
{
52
printf("%d ", temp->data);
53
temp = temp->next;
54
}
55
}
为什么不是struct node *而是struct node *,第二个函数为什么又是,就这个很糊涂,大神帮忙