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: implement odd and even elements counting with callbacks
[TD_C.git]
/
TP_13
/
exo1
/
lib
/
array.h
diff --git
a/TP_13/exo1/lib/array.h
b/TP_13/exo1/lib/array.h
index 18596b28c03f82de844f9149bb72389af7c4c4ca..ebf92c525a78f4a5178f3bd1ac6bb3f876d270ab 100644
(file)
--- a/
TP_13/exo1/lib/array.h
+++ b/
TP_13/exo1/lib/array.h
@@
-1,13
+1,21
@@
#ifndef ARRAY_H
#define ARRAY_H
#ifndef ARRAY_H
#define ARRAY_H
+#include <stdbool.h>
+
#include "sort.h"
#include "sort.h"
+typedef bool(*count_criteria_cb)(int a);
+
+bool is_even(int a);
+bool is_odd(int a);
+
int* create_tab(int tab[], unsigned tab_size);
void free_tab(int tab[]);
int* create_tab(int tab[], unsigned tab_size);
void free_tab(int tab[]);
-int* concat_tab(int tab1[], unsigned tab_size1, int tab2[], unsigned tab_size2
, int tab_dest[]
);
+int* concat_tab(int tab1[], unsigned tab_size1, int tab2[], unsigned tab_size2);
int* resize_tab(int tab[], unsigned tab_size);
int* resize_tab(int tab[], unsigned tab_size);
-int count_tab_element(int tab[], unsigned tab_size, int element);
+unsigned count_tab_element(int tab[], unsigned tab_size, int element);
+unsigned count_tab_criteria(int tab[], unsigned tab_size, count_criteria_cb c_criteria);
void sort_tab(int tab[], unsigned tab_size, criteria_cb criteria);
#endif /* ARRAY_H */
void sort_tab(int tab[], unsigned tab_size, criteria_cb criteria);
#endif /* ARRAY_H */