qsort will sort an array of elements. This is a wild function that uses a pointer to another function that performs the required comparisons.
Library: stdlib.h Prototype: void qsort(void *base, size_t num, size_t size, int (*comp_func)(const void *, const void *))
void * baseIs a pointer to the array to be sorted. This can be a pointer to any datatype.
size_t numThe number of elements.
size_t sizeThe element size.
int (*comp_func)(const void *, const void *))This is a pointer to a function.
Prototype: void qsort(void *base, size_t num, size_t size, (void *) (*comp_func)(const void *, const void *))does anyone know the answer to this problem??
Example program with user input.
Top | Master Index | Keywords | Functions |