base A pointer to the first member of the array. The pointer should be of type pointer-to-element and cast to type pointer-to-character. nmemb The number of objects in the array. size The size of an object, in bytes. compar A pointer to the comparison function.