'How to update the value pointed to by a pointer to NULL in c

I have a Linked list and head pointer is the pointer to the head of the list.

struct ListNode *head; 

If I introduce another slow pointer here like this,

struct ListNode *slow = head;

If I move the slow pointer as slow = slow->next so that it points to some other node in the list and if I want to update this node pointed by the slow pointer to NULL, I could do slow = NULL.

But this does not update the original list and if I want to make changes to the original list I would need to update this *slow instead of just the pointer slow. I tried something like this

*slow = *((struct ListNode*)0);

But that does not work. How do make this change ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source