Advertisement
Guest User

Untitled

a guest
Jun 9th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. // Update vote totals given a new vote
  2. bool vote(string name)
  3. {
  4.     for (int i = 0; i < 9; i++)
  5.     {
  6.         if (strcmp(candidates[i].name, UNKOWN ) == 0) // for the unknown value i was originally thinking "%s", candidates[i].name
  7.         {
  8.             candidates[i].votes++;
  9.             return true;
  10.         }
  11.         else if (strcmp(candidates[i].name, UNKOWN ) != 0) // for the unknown value i was originally thinking "%s", candidates[i].name
  12.         return false;
  13.     }
  14.     return false;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement