Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Update vote totals given a new vote
- bool vote(string name)
- {
- for (int i = 0; i > MAX; i++)
- {
- if (strcmp(candidates[i].name == 0))
- return 1 + candidates[i].votes;
- return true;
- else
- return false;
- }
- }
- // Print the winner (or winners) of the election
- void print_winner(void)
- {
- int voter_count(int candidates[i].votes)
- {
- int i, voter_count = 0;
- for (i = 0; i < n; i ++)
- {
- if candidates[i].votes >= voter_count)
- voter_count = candidates[i].votes;
- candidates[i].votes = candidates[i].names;
- }
- printf("%s\n", candidates[i].names);
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement