COHERENT manpages

This page displays the COHERENT manpage for strcmp() [Compare two strings].

List of available manpages
Index


strcmp() -- String Function (libc)

Compare two strings
#include <string.h>
int strcmp(string1, string2)
char *string1, *string2;

strcmp() compares string1  with string2 lexicographically.  It returns zero
if the  strings are identical, returns  a number less than  zero if string1
occurs earlier  alphabetically than string2,  and returns a  number greater
than zero if it occurs later.  This routine is compatible with the ordering
routine needed by qsort().

Example

For examples of this function, see the entries for string.h and malloc().

See Also

libc,
qsort(),
shellsort(),
string.h,
strncmp()
ANSI Standard, §7.11.4.2
POSIX Standard, §8.1