From 49c820de76fe77f032c21ffd9c6b44b185f32219 Mon Sep 17 00:00:00 2001 From: vj586da Date: Thu, 2 Dec 2021 18:06:19 +0100 Subject: [PATCH] final v2 --- a4/program.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/a4/program.c b/a4/program.c index 6771bfa..0c15870 100644 --- a/a4/program.c +++ b/a4/program.c @@ -40,7 +40,7 @@ long int* strToInt(const char* chArr, int* counter){ } //printf("counter %d\n", *counter); long* dArr = (long*)calloc(*counter, sizeof(long)); - for(int i; i < *counter; i++){ + for(int i = 0; i < *counter; i++){ dArr[i] = tmp[i]; } free(tmp); @@ -93,7 +93,7 @@ void print_tree(const long* arr, int* size){ int main(){ char chArr[SIZE]; - int counter; + int counter=0; int* counterPtr = &counter; while(1){ char* r = fgets(chArr, SIZE, stdin);