Void delall (list * head)
{
If (head==NULL)
return;
The list * node=head;
While (node - & gt; next!=NULL)
{
The list * next=node - & gt; next;
Delete the node;
The node=next;
}
The head=NULL;
}
Have a question that, although each node point to release the memory, but the pointer to the node itself is still there, in addition to the first node to NULL, the other is the original address, how to solve this?
CodePudding user response:
A pointer to an int variables have distinction? Just a memory address, an integer, if is allocated on the stack, the function returns when it released,