Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

strcmp - compare two strings

&pagelevel(4)&pagelevel

Syntax

#include <string.h>

int strcmp(const char *s1, const char *s2); 

Description

strcmp() compares strings s1 and s2 lexically, e.g.:
"circle" is lexically less than "circular";
"bustle" is lexically greater than "bus".

Return val.

Integer value:

< 0

= 0

> 0

s1 is lexically less than s2.

s1 and s2 are lexically equal.

s1 is lexically greater than s2.

Notes

Strings terminated with the null byte (\0) are expected as arguments. If this is not the case,
the result is random.

The collating sequence is based on the EBCDIC character set.

See also

strncmp(), string.h.