P
pleatofthepants
I have a maxValue function that is called when I am removing a node
from my tree.
template <class T>
T BST<T> :: maxValue (TreeNode<T>* p)
{
if (p == NULL) throw ("BAD POINTER");
while (p-> right)
{
p = p-> right;
return *this;
}
}
I am getting this error when it compiles: cannot convert BST<int> to
'int' in return
How do I fix this?
from my tree.
template <class T>
T BST<T> :: maxValue (TreeNode<T>* p)
{
if (p == NULL) throw ("BAD POINTER");
while (p-> right)
{
p = p-> right;
return *this;
}
}
I am getting this error when it compiles: cannot convert BST<int> to
'int' in return
How do I fix this?