TP 11 exo1: simplify the logic in the array creation and resizing
[TD_C.git] / TP_13 / exo1 / src / main.c
CommitLineData
e4001676 1#include <stdlib.h>
eddc018d
JB
2#include <stdio.h>
3
884e9557
JB
4#include "array.h"
5#include "utils.h"
34f864c6 6#include "io.h"
884e9557 7
eddc018d 8int main() {
884e9557 9 int* tab = NULL;
34f864c6
JB
10 const unsigned tab_size = 11;
11 tab = create_tab(tab, tab_size);
eddc018d 12
34f864c6
JB
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
34dd19e9
JB
20 printf("%d\n", tab_new_size);
21
34f864c6
JB
22 display_array(tab, tab_new_size);
23
24 free_tab(tab);
e4001676 25 exit(EXIT_SUCCESS);
eddc018d 26}