bool operator>=(const ElementType &e1, const KeyType &key);

I am trying to overload >= which compares the a string in struct e1 with a string. When I compile I get an error that:

'bool operator>=(const ElementType &e1, const KeyType &key);' must take exactly one argument

...I understand that the error is probably from trying to compare a struct element with a string, but i do not know how to fix it.

Recommended Answers

All 2 Replies

My crystal ball says that you're trying to make it a member function when it should be a non-member.

THANK you! ...I always forget about that part

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.