From 558ff3160355b197000de5c49c9090a83bd939d3 Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Mon, 19 Feb 2024 22:00:02 +0000 Subject: Mon, Feb 19, 2024, 2:00 PM -08:00 --- wk3/pset/runoff/runoff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wk3/pset/runoff/runoff.c b/wk3/pset/runoff/runoff.c index 17b4bf2..6fdfbe5 100644 --- a/wk3/pset/runoff/runoff.c +++ b/wk3/pset/runoff/runoff.c @@ -7,7 +7,7 @@ #define MAX_CANDIDATES 9 // preferences[i][j] is jth preference for voter i -int preferences[MAX_VOTERS][MAX_CANDIDATES]; +string preferences[MAX_VOTERS][MAX_CANDIDATES]; // Candidates have name, vote count, eliminated status typedef struct @@ -168,7 +168,7 @@ bool print_winner(void) { if (candidates[i].votes > (voter_count / 2)) { - printf("%s", candidate.name); + printf("%s", candidates[i].name); } } return false; -- cgit v1.2.3