void LinkList::deletenode(int value) { Node* pre = 0; Node* p = pHead; for (; p; p = p->next) { if (p->data == value) break; pre = p; } if (p != 0) { if (pre) {//判断是否是首节点 pre->next = p->next; } else { pHead = p->next;//重新设置头指针 } delete p; } else cout << "无法找到所删除的值" << endl; }```