X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TP_13%2Fexo1%2Flib%2Farray.h;h=216fa0aa0b3f2b01e2c7b9ec2e8a0129f90a4dd0;hb=59941dc1cf415077fbfbde8b313e52e8f3fc6fe5;hp=18596b28c03f82de844f9149bb72389af7c4c4ca;hpb=34f864c6720b5e480db66430a218e2fd54743ce7;p=TD_C.git diff --git a/TP_13/exo1/lib/array.h b/TP_13/exo1/lib/array.h index 18596b2..216fa0a 100644 --- a/TP_13/exo1/lib/array.h +++ b/TP_13/exo1/lib/array.h @@ -1,13 +1,21 @@ #ifndef ARRAY_H #define ARRAY_H +#include + #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* concat_tab(int tab1[], unsigned tab_size1, int tab2[], unsigned tab_size2, int tab_dest[]); -int* resize_tab(int tab[], unsigned tab_size); -int count_tab_element(int tab[], unsigned tab_size, int element); +int* concat_tab(int tab1[], unsigned tab_size1, int tab2[], unsigned tab_size2); +int* resize_tab(int tab[], unsigned old_tab_size, unsigned new_tab_size); +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 */