2
The error means a path that does not take the if branch or the else branch will not return a boolean, since the returns are embedded in those blocks.
Think about this comment //if input name does not match with any name . What the program is doing is //if input name does not match this name . If program returns on the first non-matching name, it will not ...
1
Try an election with 3 candidates, A B C, and 6 voters, with the result A 3, B 1, C 2. The self-evident winner is A with 3 votes. The first print_winner function will return C. On the first iteration of i, winner_votes will be 3. However, on the second iteration, where i equals 1, it will only compare B to C, and winner_votes will be 2.
Since the inner (j) ...
1
Have you compiled the program locally? The compiler should complain about this strlen(champions) because champions is declared an int array here int champions[pair_count]
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
pset3 × 1287game-of-fifteen × 167
find × 158
fifteen × 122
helpers × 99
breakout × 89
binary-search × 81
cs50x × 73
move × 71
check50 × 69
tideman × 59
runoff × 55
sort × 54
resize × 51
search × 51
won × 41
recover × 40
music × 40
c × 38
plurality × 37
bubble-sort × 32
segmentation-fault × 29
init × 26
resize-less × 23
linear-search × 23