summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLibravatar Mubashshir <ahmubashshir@gmail.com>2023-05-23 18:40:25 +0600
committerLibravatar Mubashshir <ahmubashshir@gmail.com>2023-05-23 18:45:10 +0600
commite382419d65562d5f79065a30931bfaef094ff984 (patch)
treeb61cdb0f226c231c77b1f907b58965b53dafb575 /src/main.c
parent09133381cad0a1dec37595867eadf9c6858ce8ee (diff)
downloadc-obp-example-e382419d65562d5f79065a30931bfaef094ff984.tar.gz
c-obp-example-e382419d65562d5f79065a30931bfaef094ff984.zip
Clean up more code
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index afa1eeb..d8bc1ac 100644
--- a/src/main.c
+++ b/src/main.c
@@ -12,12 +12,12 @@ int main()
{
unsigned num = 0, i = 0;
char line[255] = "";
- TEAM *teams;
+ team *teams;
getline(line, 255);
sscanf(line, "%u", &num);
strncpy(line, "", 255);
- teams = (TEAM *)malloc(sizeof(TEAM) * num);
+ teams = (team *)malloc(sizeof(team) * num);
if (teams == NULL) {
printf("Failed to reserve memory");
@@ -52,6 +52,9 @@ int main()
}
}
- fun(team, printf, fun(team, find_champion, NULL, teams, num));
+ team champion = ask(team, find_champion, NULL, teams, num);
+ ask(team, printf, champion);
+
+ while(num --) del(team, teams[num]);
return 0;
}