Files
oldlinux-files/Minix/2.0.0/wwwman/man3/qsort.3.html
2024-02-19 00:21:39 -05:00

70 lines
1.4 KiB
HTML

<HTML>
<HEAD>
<TITLE>qsort(3)</TITLE>
</HEAD>
<BODY>
<H1>qsort(3)</H1>
<HR>
<PRE>
</PRE>
<H2>NAME</H2><PRE>
qsort - quicker sort
</PRE>
<H2>SYNOPSIS</H2><PRE>
<STRONG>#include</STRONG> <STRONG>&lt;sys/types.h&gt;</STRONG>
<STRONG>#include</STRONG> <STRONG>&lt;stdlib.h&gt;</STRONG>
<STRONG>void</STRONG> <STRONG>qsort(void</STRONG> <STRONG>*</STRONG><EM>base</EM><STRONG>,</STRONG> <STRONG>size_t</STRONG> <EM>nel</EM><STRONG>,</STRONG> <STRONG>size_t</STRONG> <EM>width</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <STRONG>(*</STRONG><EM>compar</EM><STRONG>)(const</STRONG> <STRONG>void</STRONG>
<STRONG>*,</STRONG> <STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*))</STRONG>
</PRE>
<H2>DESCRIPTION</H2><PRE>
<STRONG>Qsort</STRONG> is an implementation of the quicker-sort algorithm. The first
argument is a pointer to the base of the data; the second is the number
of elements; the third is the width of an element in bytes; the last is
the name of the comparison routine to be called with two arguments which
are pointers to the elements being compared. The routine must return an
integer less than, equal to, or greater than 0 according as the first
argument is to be considered less than, equal to, or greater than the
second.
</PRE>
<H2>SEE ALSO</H2><PRE>
<STRONG><A HREF="../man1/sort.1.html">sort(1)</A></STRONG>.
</PRE>
</BODY>
</HTML>