well if you are using a char * then you can just use strcmp.
If you are using std::string then it already has built in comparisons
strcmp(a,b) returns >1 if a > b, < 1 if a < b, or 0 if a==b.
Generally i only write two comparison operators and then use those two for the other four
Code:
bool operator == (const char *a, const char *b)
{
return strcmp(a,b) == 0;
}
bool operator > (const char *a, const char *b)
{
return strcmp(a,b) > 1;
}
bool operator >= (const char *a, const char *b)
{
return (a==b) || (a>b);
}
Warning: I have not compiled or tested the above code and am not 100% sure it is correct, or if you can even overload the comparison between to char * in such a manner.