List::~List()
{
Node *temp;
tail->next = NULL;//breaks circularity of list
tail = NULL;
delete tail;
while(head)
{
temp = head;
head = head->next;
delete temp;
}
delete head;
}
your sinister little sister
List::~List()
{
Node *temp;
tail->next = NULL;//breaks circularity of list
tail = NULL;
delete tail;
while(head)
{
temp = head;
head = head->next;
delete temp;
}
delete head;
No comments:
Post a Comment