Is there a way to point to the pointer variable instead of it's address space so that it can be changed to NULL. Something like this. Apologies for the poor question I can't think of a better way of expressing what I'm trying to do. Thanks.
typedef struct Node
{
int val;
struct Node *r;
struct Node *l;
} Node;
Node* del(Node *N, int v)
{
Node *n = N;
Node **p = NULL;
while (n != NULL)
{
if (something)
{
p = n.r;
n = n->r;
}
else {
p = n.l;
n = n->l;
}
free(n);
*p = NULL;
}
}