


      QSORT(3C)                   (UNIX 5.0)                  QSORT(3C)



      NAME
           qsort - quicker sort

      SYNTAX
           void qsort ((char *) base, nel, sizeof (*base), compar)
           unsigned int nel;
           int (*compar)( );

      DESCRIPTION
           Qsort is an implementation of the quicker-sort algorithm.
           It sorts a table of data in place.

           Base points to the element at the base of the table.  Nel is
           the number of elements in the table.  Compar is the name of
           the comparison function, which is called with two arguments
           that point to the elements being compared.  The function
           must return an integer less than, equal to, or greater than
           zero according as the first argument is to be considered
           less than, equal to, or greater than the second.

      NOTES
           The pointer to the base of the table should be of type
           pointer-to-element, and cast to type pointer-to-character.
           The comparison function need not compare every byte, so
           arbitrary data may be contained in the elements in addition
           to the values being compared.
           Although declared as type pointer-to-character, the value
           returned should be cast into type pointer-to-element.

      SEE ALSO
           sort(1), bsearch(3C), lsearch(3C), string(3C).
























      Page 1                                         (73 A2 02MTA REV1)



