TP 11 exo1: simplify the logic in the array creation and resizing
[TD_C.git] / TP_13 / exo1 / src / main.c
... / ...
CommitLineData
1#include <stdlib.h>
2#include <stdio.h>
3
4#include "array.h"
5#include "utils.h"
6#include "io.h"
7
8int main() {
9 int* tab = NULL;
10 const unsigned tab_size = 11;
11 tab = create_tab(tab, tab_size);
12
13 printf("%d\n", tab_size);
14
15 display_array(tab, tab_size);
16
17 const unsigned tab_new_size = 20;
18 tab = resize_tab(tab, tab_new_size);
19
20 printf("%d\n", tab_new_size);
21
22 display_array(tab, tab_new_size);
23
24 free_tab(tab);
25 exit(EXIT_SUCCESS);
26}