removing a node from C++ list

Hi !
following is some code. the problem is with the remove() function coded below.
i want to remove the nodes found in the list which is pretty clear from the remove function, but removal is not working....
kindly help...

Who is Participating?

list::remove() removes all elements that have are equal to the specified value. i.e. it iterates through each item in the list and compares each item to the specified value, if they are the same, it deletes the item from the list. (you could potentially be able to make the list::remove() function work for you by using an appropriate overloaded operator == function and a vey different algoritm in your remove() function.

list::erase() erases an element specified by an iterator, so this is the type of erasure/removal you are trying to do.