my tabulate function is storing votes from the preferences array, but problem arising when multiple candidates are eliminated check50 shows error there. Please help me with this, and tell me what is going on under the hood with multiple candidates, also how can I debug this problem myself in debug50? I will really appreciate your help, TIA
:) tabulate counts votes when all candidates remain in election :) tabulate counts votes when one candidate is eliminated :( tabulate counts votes when multiple candidates are eliminated tabulate function did not produce correct vote totals
void tabulate(void)
{
int j = 0;
for (int i = 0; i < voter_count; i++)
{
if (candidates[preferences[i][j]].eliminated == true)
{
j++;
}
candidates[preferences[i][j]].votes++;
}
}