X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TP_13%2Fexo1%2Flib%2Farray.h;h=ebf92c525a78f4a5178f3bd1ac6bb3f876d270ab;hb=889d586254feccc26f294af86ce7e698ea006dfb;hp=9c06bc8eeee90c70d1f927565ca3dfd07ea2ee5e;hpb=884e95575f85cb863b53910d203759a5cfc68d81;p=TD_C.git diff --git a/TP_13/exo1/lib/array.h b/TP_13/exo1/lib/array.h index 9c06bc8..ebf92c5 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" -int create_tab(int tab[], unsigned tab_size); +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 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 */