I have a link list and i wish to delete the entire list
free the memory back to the OS. Does the following codes
does what i want?
List* list = new List;
delete list; // list points to the head
list = NULL; // of the link list
Or should i do a loop.
List* temp = list;
list = list->next;
temp = list;
list = temp = NULL;
Does the first method works? What is the best way to
free the memory held by a link list? I want to be
sure that all memory is free, does the second method
actually free the entire list or i must go into the
list and free every variable one by one.