Without seeing the header that declares the Node class we can only guess. My guess is getItem is a method of the class so you need have parenthesis to call it :
getItem()
.
Note - the
GetptrTo
function also needs to return something. I would guess it needs to return
ptr
.
Guessing again, it should probably look something like this :
Node<T>* GetPtrTo( T k )
{
Node<T>* ptr = getHead();
while( ptr )
{
if( ptr->getItem() == k )
break;
ptr = ptr->getNext();
}
return ptr;
}
One last thing - isn't
GetptrTo
a method of the
Node
class? It looks like it should be to access the
Head
item. I would make a method for the class to access the list's
Head
item.