The following code snippet is from:
http://www.eskimo.com/~scs/cclass/int/sx8.html
The code deletes a node from a linked list:
Code:
struct list **lpp;
for(lpp = &list; *lpp != NULL; lpp = &(*lpp)->next)
{
if((*lpp)->item == i)
{
*lpp = (*lpp)->next;
break;
}
}
}
The part of the construction I don't really understand is
Code:
lpp = &(*lpp)->next
Can someone break this part piece by piece? Like explain why the & operator is necessary. Why we just can't do something like
lpp->next, etc.
Thanks
Chad