I get the error for the two arguments of my function:
//incompatible type for argument of swapStruct
//expected Men100mParticipant but argument is of type struct <anonymous>
My code is like this:
int main(){
...
swapStruct(phaseToBeSorted->phase_result[j-1], phaseToBeSorted->phase_result[j]); //error
...
}
phaseToBeSorted is of type Men100mPhaseDetails that is defined as:
typedef struct Men100mPhaseDetails{
char* nameCurrentPhase;
int current_phase;
Men100mParticipant phase_result;
} Men100mPhaseDetails * Men100mPhaseDetails;
While pase_result is supposed to be an array of Men100mparticipant. The typedef is given as is and I can't change it.
This is the declaration of Men100mparticipant:
typedef struct {
char nameOfParticipant[MAX_LEN_NAME];
double* scores[4];
} Men100mparticipant, *Men100mParticipant;
and this the declaration of the function swapStruct:
static void swapStruct(Men100mParticipant a, Men100mParticipant b);
I don't understand what is the problem and I'll be glad to get some help in solving the problem.