Skip to content

Commit 8519c06

Browse files
authored
Update 5.4.3检查函数正确性的套路.md
1 parent e0419a1 commit 8519c06

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

5.4.3检查函数正确性的套路.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,13 @@
5656

5757
4. 检查错误条件
5858
1. 若head传入的是空,则line 1会出错。
59+
```c
60+
void removeHead(ListElement** head){
61+
if(head && *head){
62+
ListElement *temp = (*head)->next;// line 1
63+
free(*head);// line 2
64+
*head = temp;// line 3
65+
}
66+
}
67+
```
68+
现在可以宣布调试完成。

0 commit comments

Comments
 (0)