Next Previous Contents

## 3.123 qsort

> Function

>   Sort an array.

> Header

>   `stdlib.h`

> Declaration

>   `void __fastcall__ qsort (void* base, size_t count, size_t size, int (*compare) (const void*, const void*));`

> Description

>   `qsort` sorts an array according to a given compare function `compare`. `base` is the address of the array, `count` is the number of elements, `size` the size of an element and `compare` the function used to compare the members.

> Limits

>   - If there are multiple members with the same key, the order after calling the function is undefined.
>   - The function is only available as fastcall function, so it may only be used in presence of a prototype.
> Availability

>   ISO 9899

> See also

>   bsearch

> Example

>   None.

Next Previous Contents