summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLibravatar Mubashshir <ahmubashshir@gmail.com>2023-05-23 17:19:44 +0600
committerLibravatar Mubashshir <ahmubashshir@gmail.com>2023-05-23 17:19:44 +0600
commit413e443613499a53cc4aa1f35664c289ffbde04b (patch)
tree37deab8142fd80ab9ef17bb970d2beef5e53796d /src/main.c
parent5942f6125ea85bc78fc3df7b2f72b41260f4b4a2 (diff)
downloadc-obp-example-413e443613499a53cc4aa1f35664c289ffbde04b.tar.gz
c-obp-example-413e443613499a53cc4aa1f35664c289ffbde04b.zip
Add new operators
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Diffstat (limited to '')
-rw-r--r--src/main.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index faf76f7..2cc35fa 100644
--- a/src/main.c
+++ b/src/main.c
@@ -24,25 +24,25 @@ int main()
}
for(i = 0; i < num; i++) {
- teams[i] = team_new();
+ teams[i] = new(team);
unsigned idx = 0, s = 0;
while (idx ++ < 6) {
getline(line, 255);
switch(idx) {
case 1:
- team_set(teams[i], name, line);
+ set(team, teams[i], name, line);
break;
case 2:
- team_set(teams[i], institution, line);
+ set(team, teams[i], institution, line);
break;
case 3:
sscanf(line, "%u", &s);
- team_set(teams[i], solved, s);
+ set(team, teams[i], solved, s);
break;
case 4: // falls through
case 5: // falls through
case 6:
- team_set(teams[i], member_name, idx - 3, line);
+ set(team, teams[i], member_name, idx - 3, line);
break;
default:
break;
@@ -50,6 +50,7 @@ int main()
strncpy(line, "", 255);
}
}
- team_printf(team_find_champion(teams, num));
+
+ fun(team, printf, fun(team, find_champion, NULL, teams, num));
return 0;
}