well first of all, if you define the "operator <=" outside a class, you have to precede it with "ClassName::". also there's only one parameter into "operator <=" the other parameter is the Name object itself, or the "this" object. take a look at this small example. it overloads the "<=" operator to base the comparison off the length of the strings, not the characters:


#include <iostream.h>
#include <string.h>

class Name
{
public:
Name(char *c)
{
strcpy (m_name, c);
}

operator <= (Name &a)
{
return strlen(m_name) <= strlen(a.m_name);
}

private:
char m_name[64];
};

void main()
{
Name n("abcdefg");
Name m("h");

if (n <= m)
{
cout << "abcdefg <= h" << endl;
}
else
{
cout << "abcdefg > h" << endl;
}
}