LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 505|回复: 1

链表的节点删除 为什么删不掉!

[复制链接]
发表于 2004-5-27 21:02:30 | 显示全部楼层 |阅读模式
typedef struct st {
int date;
struct st *next;
} ST;
ST* MOVE_ST(ST* head,int key)
{
ST* p,q;
p=head;
if (p==NULL) return head;
while (p!=NULL) {
if (p->next->date==key) {
q=p->next;
p->next=p->next->next;
free(q);
}
p=p->next;
}
return head;
}

警告(line 7):你定义的q不是指针。
发表于 2004-5-27 21:23:54 | 显示全部楼层
ST *p, *q;
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表