1

So, I see a logic error in this bit of code: if (winner_int < candidates[i].votes) { winner = candidates[i].name; } Since you set winner_int equal to the number of votes that candidate[0] and never change that value, this will not always provide a valid winner in each situation. If candidate[0].votes == 3, candidate[1].votes == 4, and candidate[2]....


1

Yea, in true rubber duck fashion I figured out the problem immediately after posting this..., why would I ever want to += instead of just =...


Only top voted, non community-wiki answers of a minimum length are eligible