I’m trying to return a left child as a pointer
I have
template <typename Type>
class BSTNode {
private:
int key;
Type data;
BSTNode *left;
BSTNode *right;
}
And root
template <typename Type>
class BST {
private:
BSTNode<Type> *root;
}
I absolutely need this, I can’t find a way around it (not in the little time I have left)
this->root = auxRoot.getLeftChild();
here is getLeft
template <typename Type>
BSTNode<Type> *BSTNode<Type>::getLeftChild() {
return this->left();
}
Compiling error: left cannot be used as a function. Am I doing somethign wrong ?
leftisn’t a function, but a data member, so the parenthesis are illegal. It should be: