head is defined in the header file as a NodeType*.
and typedef int dataType; is in the header also.
This is the code i am trying to delete with:
1 2 3 4 5 6 7 8 9 10 11 12
void Container::deleteList(void)
{
nodePtr tempPtr;
while ( head != NULL )
{
tempPtr = head;
head = head->link;
delete tempPtr;
}
}
I have a function that adds items to the list then I want to be able to run this delete function to delete the entire list, so i dont have any memory leaks.
this piece of code keeps giving me the error "must take exactly one argument". It is inside the Container class and I want to use it to see if two classes are equal.
the implimitation is:
1 2 3 4 5
booloperator ==(Container a, Container b)
{
return
a.head == b.head;
}