.TH strcmp() "" "" "String Function (libc)"
.PC "Compare two strings"
.B "#include <string.h>"
\fBint strcmp(\fIstring1\^\fB, \fIstring2\^\fB)\fR
\fBchar *\fIstring1\^\fB, *\fIstring2\^\fB;\fR
.PP
.B strcmp()
compares
.I string1
with
.I string2
lexicographically.
It returns zero if the strings are identical,
returns a number less than zero if
.I string1
occurs earlier alphabetically than
.IR string2 ,
and returns a number greater than zero if it occurs later.
This routine is compatible with the ordering routine needed by
.BR qsort() .
.SH Example
For examples of this function, see the entries for
.B "string.h"
and
.BR malloc() .
.SH "See Also"
.Xr "libc," libc
.Xr "qsort()," qsort
.Xr "shellsort()," shellsort
.Xr "string.h," string.h
.Xr "strncmp()" strncmp
.br
\*(AS, \(sc7.11.4.2
.br
\*(PX Standard, \(sc8.1
