void deleteNode(ListNode* node)
{
if(node>next)
{
node>val=node>next>val;
node>next=node>next>next;
}
else
node=NULL;
}
So easy with c++!

@Johnson04 how about this?
node>val = node>next>val; struct ListNode* temp = node>next; node>next = node>next>next; free(temp);
Also I think there is no need to check
if(node>next)
as the question says "delete a node (except the tail)"