void delete_node(Node *head, Node *node) {
Node *next = node->next;
if(next==NULL) { /* if the node is the tail of the list */
Node *curr_node = head;
while(curr_node->next!=node) { curr_node= curr_node->next; }
curr_node = NULL;
delete node;
return;
}
memmov(node, next, sizeof(Node));
delete next;
}
其实这个办法删除的只是node的内容, 而真正删除的是node->next节点.