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);