I've been trying to solve the new problem set 3 plurality step by step, and here where I got stuck, but somehow I'm sure about my answer
bool vote(string name)
{
bool v = false
for (int i = 0 ; i < candidate_count ; i++)
{
if (strcmp( candidates[i].name , name ) == 0)
{
candidates[i].votes += 1;
v = true ;
break ;
}
}
return v ;}
when I run the program
~/pset3/plurality/ $ ./plurality sara zack eric
Number of voters: 1
Vote: sara
Invalid vote.
bool v = false
looks like it should give error on compile. – DinoCoderSaurus Jan 18 '20 at 17:48