【发布时间】:2013-03-19 02:36:58
【问题描述】:
我的程序使用链表按顺序输入数字。
My input: 2 4 23 34 534 543
当我去删除列表时,我得到了这个:
137429056 137428992 137429040 137429024 137429008 0
这是为什么呢?
void deleteList(node* head)
{
if(head == NULL)
printf("List is empty\n");
else
deleteList(head->next);
free(head);
}
【问题讨论】:
标签: c recursion linked-list