通过给定的指针直接删除节点没有实际的解决方案,需要做一些技巧。通过给定的要删除的指针将数据从下一个节点复制到当前节点并删除下一个节点。
参考示例:
//Get the Address of the next node
NodePointer temp = Node->pNextNode;
//Get the data of next node
Node->iData = temp->iData;
//Get the Address of next to next node
Node->pNextNode = temp->pNextNode;
//Delete the next node
free(temp);