struct nodeStructType {
char letter;
int count;
};
struct node {
nodeStructType data;
node* left;
node* right;
bool operator <(const node* comp)
{
return data.letter < comp->data.letter;
}
};
typedef node* nodePtr;
Hi! I'm working on a project and am overloading the < operator like this. However, when calling
a = myTree.GetANode('a', 0);
b = myTree.GetANode('b', 0);
if (a < b)
{
printf("yay!");
}
, a and b both being nodePtr's, it is not returning true. GetANode function just sets data.letter to 'a' and 'b'