repositories
/
TD_C.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TP 13 exo1: return the dynamic array created or modified when necessary
[TD_C.git]
/
TP_13
/
exo1
/
src
/
main.c
diff --git
a/TP_13/exo1/src/main.c
b/TP_13/exo1/src/main.c
index 1b93898fe8cea2126dcfd4162f9f95446f0b227f..658930e3c75be49a87ef13a9735a653c8576941d 100644
(file)
--- a/
TP_13/exo1/src/main.c
+++ b/
TP_13/exo1/src/main.c
@@
-3,11
+3,22
@@
#include "array.h"
#include "utils.h"
#include "array.h"
#include "utils.h"
+#include "io.h"
int main() {
int* tab = NULL;
int main() {
int* tab = NULL;
- c
reate_tab(tab, 11)
;
-
const unsigned tab_size = ARRAY_SIZE(tab
);
+ c
onst 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);
+
+ display_array(tab, tab_new_size);
+
+ free_tab(tab);
exit(EXIT_SUCCESS);
}
exit(EXIT_SUCCESS);
}