This part of the repo contains basic exercises to learn how to use generic functions with void *
ponters.
Any_copy allows to copy an entire memory area (equals to memcpy
C standard function).
void any_copy(void *dest, const void *src, size_t n)
Source code is available here.
Binary_search allows to sort a generic array (equals to bsearch
C standard function).
void *binary_search(const void *key, const void *base, size_t num_elem, size_t elem_size, int (*compar)(const void *, const void *));
Source code is available here.
Dump_array allows to dump a generic array into a file.
void dump_array(const void *base, size_t num_elem, size_t elem_size, void (*dump_element)(const void *, FILE *), FILE *fp)
Source code is available here.