Skip to content

Commit

Permalink
翻转单链表,头结点没有初始化
Browse files Browse the repository at this point in the history
翻转单链表,头结点没有初始化,会导致后面无法遍历
  • Loading branch information
sty945 authored Jan 8, 2019
1 parent 43af376 commit adcbdda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c-cpp/06_linkedlist/single_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct single_list** search(struct single_list_head* head, int target)

void reverse(struct single_list_head* head)
{
struct single_list_head tmp;
struct single_list_head tmp = {NULL};
struct single_list *elem;

while (!is_empty(head)) {
Expand Down

0 comments on commit adcbdda

Please sign in to comment.