C-Function-Pointers
C-Function-Pointers
Computing Lab
https://www.isical.ac.in/~dfslab
#include <stdlib.h>
Sorting
void qsort(void *base, size_t nmemb, size_t size,
int (*compar)(const void *, const void *));
Searching
void *bsearch(const void *key, const void *base,
size_t nmemb, size_t size,
int (*compar)(const void *, const void *));
char **strings;
int *a;
int num_strings, N;
where
L is the input list;
N is the number of elements in L;
domain_elt_size (and range_elt_size, resp.) correspond to the size of each
element of the domain and range of f : X → Y ; and