void DeleteList(struct node** headRef)
{
struct node* current = *headRef; // deref headRef to get the real head
struct node* next;
while (current != NULL)
{
next = current->next; // note the next pointer
free(current); // delete the node
current = next; // advance to the next node
}
*headRef = NULL; // Again, deref headRef to affect the real head back
// in the caller.
}

Comments (1)

On March 13, 2011 at 5:09 AM , Aashik Manandhar said...

jkj
jkj
jk
kjkjkj

 

CSS Menu Samples