*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> qsort (3)              



NAME    [Toc]    [Back]

       qsort - sorts an array

SYNOPSIS    [Toc]    [Back]

       #include <stdlib.h>

       void qsort(void *base, size_t nmemb, size_t size,
	      int (*compar)(const void *, const void *));

DESCRIPTION    [Toc]    [Back]

       The  qsort()  function sorts an array with nmemb elements of size size.
       The base argument points to the start of the array.

       The contents of the array are sorted in ascending order according to  a
       comparison  function  pointed  to  by  compar, which is called with two
       arguments that point to the objects being compared.

       The comparison function must return an integer less than, equal to,  or
       greater	than  zero  if	the first argument is considered to be respectively
 less than, equal to, or greater than the second.	If two members
       compare as equal, their order in the sorted array is undefined.

RETURN VALUE    [Toc]    [Back]

       The qsort() function returns no value.

CONFORMING TO    [Toc]    [Back]

       SVID 3, POSIX, BSD 4.3, ISO 9899

SEE ALSO    [Toc]    [Back]


GNU				  1993-03-29			      QSORT(3)
[ Back ]
 Similar pages
Name OS Title
evmsort Tru64 Sorts events
sort Tru64 Sorts or merges files
scandir Tru64 Scan or sorts directory contents
dmPMSortByName IRIX sorts the list of plugins stored in
alphasort Tru64 Scan or sorts directory contents
tsort Tru64 Sorts an unordered list of ordered pairs (topological sort)
asort Tru64 Sorts or merges files and supports multiple collating weight sequences
unpack IRIX Unpacks an array of rank one into an array under control of a mask
sum IRIX Sums array elements
glcolorpointer IRIX define an array of colors
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service