【发布时间】:2015-12-06 23:03:38
【问题描述】:
我想从链表中删除一个节点,但它不起作用。这是我的代码:
jL Delete(jL* node,int n)
{
jL first1, n_th, save;
int count = 0;
save = first1 = n_th = (*node);
while(first1->next)
{
first1 = first1->next;
count++;
if(count == (n-1))
break;
}
while ( first1->next != NULL )
{
first1 = first1->next;
save = n_th;
n_th = n_th->next;
}
save->next = n_th->next;
free(n_th);
return (&node);}
我的错误在哪里?你能帮帮我吗
【问题讨论】:
-
不显示数据声明,修改本地副本,返回参数地址。这应该足够了。
-
哦,调试器............DCV
-
我已经回滚了你的编辑 - 如果你想删除你的问题,请这样做,但不要只是删除代码 - 它使你的问题无法理解,而且它呈现现有的回答没用。
标签: c data-structures linked-list