以B作为删除的节点,代码思路如下:
{ line *temp = head; while(temp) { if (temp.data == date) { //B as temp temp->next->prev = temp->prev; //M1 temp->prev->next = temp->next; //M2 if (temp) free(temp); return head;//?? } temp = temp->next; } }
return head 把temp作为一个head节点
原文:https://www.cnblogs.com/real-watson/p/14610323.html