# [LeetCode 237. Delete Node in a Linked List]
###### tags: `Leetcode`
* 題目
Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list, instead you will be given access to the node to be deleted directly.
It is guaranteed that the node to be deleted is not a tail node in the list.
* 解法
* 單純把現題目給的節點的val跟next,直接替換成當前node的下個node的val跟next即可
```
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* struct ListNode *next;
* };
*/
void deleteNode(struct ListNode* node) {
node->val = node->next->val;
node->next = node->next->next;
}
```