TP 11 exo1: simplify the logic in the array creation and resizing
[TD_C.git] / TP_13 / exo1 / src / main.c
index 06f5f8d66140d669cb3a97bedd47405c4593e2f5..9f23749fbc3b2def57ca83457ac762d44e426e0a 100644 (file)
@@ -1,7 +1,26 @@
+#include <stdlib.h>
 #include <stdio.h>
 
+#include "array.h"
+#include "utils.h"
+#include "io.h"
+
 int main() {
-    printf("Hello world\n");
+    int* tab = NULL;
+    const unsigned tab_size = 11;
+    tab = create_tab(tab, tab_size);
+
+    printf("%d\n", tab_size);
+
+    display_array(tab, tab_size);
+
+    const unsigned tab_new_size = 20;
+    tab = resize_tab(tab, tab_new_size);
+
+    printf("%d\n", tab_new_size);
+
+    display_array(tab, tab_new_size);
 
-    return 0;
+    free_tab(tab);
+    exit(EXIT_SUCCESS);
 }