my code
for (int i = 0; i < candidate_count; i++)
{
if (strcmp(candidates[i].name, name) == 0)
{
preferences[voter][rank] = i;
return true;
}
}
I'm able to printout the correct matrix later in my code.
But I struggle to understand why preferences[voter][rank] = i;
only seems to update the rank value, but not sure if it's correct?
What if i also wanted to update the voter value?
PS: Can't seem to find a good guide online explaining how to update two dimensional c arrays like this!