Tag: 访问违规

删除链接列表中具有特定值的所有节点

标题非常自我解释。 这是我为此目的编写的函数: void wipeLoneCells() { cell *tmp; tail = head; while (1) { if (head == tail && !tail->flag) { head = head->next; free(tail); tail = head; continue; } tmp = tail->next; /***/ if (tmp->next == NULL && !tmp->flag) { tail->next = NULL; free(tmp); break; } else if (!tmp->flag) { tail->next = tmp->next; free(tmp); continue; […]