I have this types defined:
#define NAME_LENGTH_LIMIT 25
#define LNULL (-1)
#define MAX 1000
typedef char tParticipantName[NAME_LENGTH_LIMIT];
typedef int tNumVotes;
typedef bool tEUParticipant;
typedef struct tItemL {
tParticipantName participantName;
tNumVotes numVotes;
tEUParticipant EUParticipant;
} tItemL;
typedef int tPosL;
typedef struct tList {
tItemL data[MAX];
tPosL lastPos;
} tList;
This code below is creating problems, because it needs to read a character but when I insert one I recived this error-> error: invalid operands to binary == (have 'tItemL' and 'tItemL').
tPosL findItem(tItemL d, tList L) {
tPosL t;
if (L.lastPos == LNULL) {
return LNULL;
} else {
t = first(L); //p=0;
while (t != LNULL && (L.data[t] == d)) { //error in this line
t = next(t, L);
}
if (L.data[t] == d) return t;//error in this line
else return LNULL;
}
}
I don't know how to solve the problem