diff --git a/ex1/ex1.c b/ex1/ex1.c index 5b34c5e9b939279a3a8866387ad92f22a9ed7d2a..06f50f76541ce680f336dbd5cc1962e40adf4059 100644 --- a/ex1/ex1.c +++ b/ex1/ex1.c @@ -13,8 +13,10 @@ #include <stdio.h> #include <stdlib.h> +#define VALUES_LENGTH 8 + int main() { - int32_t values_length = 8; + int32_t values_length = VALUES_LENGTH; int32_t values[values_length]; // Reading of the 8 input values. diff --git a/ex2/ex2.c b/ex2/ex2.c index f9218680a48cd2cb0331230607928b5a8f5f1fef..90aee29c26c79c2dd319628de9c58f5349de21c5 100644 --- a/ex2/ex2.c +++ b/ex2/ex2.c @@ -14,6 +14,8 @@ #include <stdio.h> #include <stdlib.h> +#define VALUES_LENGTH 4 + // LinkedListNode.h typedef struct LinkedListNode { @@ -255,7 +257,7 @@ void linked_list_remove_at_index(LinkedList *list, int32_t index) { } int main() { - int32_t values_length = 4; + int32_t values_length = VALUES_LENGTH; int32_t values[values_length]; // Reading of the 4 input values to be added to the list. @@ -278,7 +280,7 @@ int main() { LinkedList *list = linked_list_new(); // Addition of the 4 numbers read as input in the list. - for (int32_t i = 4 - 1; i >= 0; i -= 1) { + for (int32_t i = values_length - 1; i >= 0; i -= 1) { linked_list_add_last(list, values[i]); }