qsort(3) — Subroutines
OSF
NAME
qsort − Sorts a table in place
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <stdlib.h> void qsort(
void ∗base,
size_t nmemb,
size_t size,
int ((∗compar)(const void ∗, const void ∗)) ;
PARAMETERS
basePoints to the first entry in the table.
nmembSpecifies the number of entries in the table.
sizeSpecifies the size in bytes of each table entry.
comparPoints to the user-specified function to be used to compare pairs of table elements. The comparison function will be called with two parameters that point to the two elements to be compared. The comparison function must return an integer less than, equal to, or greater than zero, depending on whether the first element in the comparison is considered less than, equal to, or greater than the second element.
DESCRIPTION
The qsort() function sorts a table having a specified number of entries. The contents of the table are sorted in ascending order according to a user-specified comparison function (the strcmp() function, for example).
NOTES
The comparison function need not compare every byte, so arbitrary data may be contained in the elements in addition to the values being compared.
When two members compare equal, their order in the sorted array is indeterminate.
AES Support Level:
Full use
RELATED INFORMATION
Functions: bsearch(), lsearch()