strcmp (3)
Leading comments
Copyright 1993 David Metcalfe (david@prism.demon.co.uk) %%%LICENSE_START(VERBATIM) Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Sin...
NAME
strcmp, strncmp - compare two stringsSYNOPSIS
#include <string.h> int strcmp(const char *s1, const char *s2); int strncmp(const char *s1, const char *s2, size_t n);
DESCRIPTION
The strcmp() function compares the two strings s1 and s2. It returns an integer less than, equal to, or greater than zero if s1 is found, respectively, to be less than, to match, or be greater than s2.The strncmp() function is similar, except it compares only the first (at most) n bytes of s1 and s2.
RETURN VALUE
The strcmp() and strncmp() functions return an integer less than, equal to, or greater than zero if s1 (or the first n bytes thereof) is found, respectively, to be less than, to match, or be greater than s2.ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).Interface | Attribute | Value |
strcmp(), strncmp() | Thread safety | MT-Safe |