strcmp

This macro compares two strings based on the internal machine representation of the characters. For example, ASCII A has the value 41 in hexadecimal notation and ASCII B has the value 42 in hexadecimal notation, A is less than B.

This macro behaves like the strcmp function in the ANSI C string library.

Syntax:

unsigned long strcmp (str1, str2)
char *
str1, *str2;

where:

str1                       Variable of type pointer to char. Specifies the location in memory of the first byte of a character string.

str2                       Variable of type pointer to char. Specifies the location in memory of the first byte of a character string.

Return Value

int                  One of the following:.

-1         Indicates that the second argument string value comes after the first argument string value in the machine collating sequences, str1 < str2.

0          Indicates that the two strings are identical in content.

1          Indicates that the first argument string value comes after the second argument string value in the machine collating sequences, str2 < str1.

Rules