关于c中的结构体的操作符问题
我定义的一个结构体
typedef struct
{
char number[4],name[20];
int sex,basic_wage,allowance,bath_haircut_fees;
int water_elec_fees,rent,rest;
}ELEMENTYPE;
但我对其进行比较操作时报错
int locate_seqlist(SEQUENLIST L,ELEMENTYPE x)
{
int i;
for(i=1;i<=L.last;i++)
if(L.elements[i] == x)
return i;
return 0;
}
错:error C2676: binary '==' : 'ELEMENTYPE' does not define this operator or a conversion to a type acceptable to the predefined operator
请问如何对结构体进行比较操作?