I'm a beginner and CS50 is the first coding experience I have. Like the title says, my code works when I test it but the CS50 won't accept it so I'm not sure what's wrong. Thanks for any help!
ps. I can add the whole code if necessary. Didn't want to clog the question if it wasn't.
void print_winner(int voter_count)
win = 0;
int w = 0;
for (w = 0; w<voter_count; w++)
{
if (candidates[w].votes>win)
win = candidates[w].votes;
}
for(int j = 0; j<voter_count; j++)
if(win == candidates[j].votes)
{
printf("%s\n", candidates[j].name);
}
return;
}