strcmp
Function
Compare two strings
Synopsis
unsigned long strcmp (str1, str2)
char *str1,
char *str2;
Description
The strcmp macro compares strings in lexicographic order. Lexicographic
order means that characters are compared based on their internal machine
representation. For example, because an ASCII 'A' is 41 hexadecimal and an
ASCII 'B' is 42 hexadecimal, 'A' is less than 'B'.
The strings str1 and str2 are compared and a result is returned according to the
following relations:
relation
s1 < s2
s1 = s2
s1 > s2
Diagnostics
Strings are assumed to be NULL terminated or to be within the array
boundaries. The comparison is always signed, regardless of how the string is
declared.
Chapter 11: Predefined Macros
result
negative integer
zero
positive integer
strcmp
473