Hi,
I am attempting to overload the '<' operator in order to sort an array structure, but get a syntax error in Borland Builder5.
Code as follows:
As far as I can see, this syntax matches several examples I have found on the Web. Any idea what I'm doing wrong?
Thanks
Doug
I am attempting to overload the '<' operator in order to sort an array structure, but get a syntax error in Borland Builder5.
Code as follows:
Code:
struct GroupTeamType
{
AnsiString Name;
int Played;
int Won;
int Drawn;
int Lost;
int GoalsFor;
int GoalsAgainst;
int GoalDiff;
int Points;
};
GroupTeamType Group[4];
// This line gives 'Declaration syntax error
bool operator <(const GroupTeamType &first, const GroupTeamType &second)
{
return first.Points < second.Points;
}
Thanks
Doug
Comment