Skip to content
Snippets Groups Projects
Commit 42010cde authored by florian.burgener's avatar florian.burgener
Browse files

Add constants

parent 35199ddc
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
......@@ -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]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment