Everything

strcmp


Compares the contents of two strings specified.

[Format]

#include <string.h>

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

[Return values]

If string pointed by s1 > string pointed by s2: Positive value

If string pointed by s1 == string pointed by s2: 0

If string pointed by s1 < string pointed by s2: Negative value

[Parameters]

s1 Pointer to the reference string to be compared

s2 Pointer to the string to compare to the reference

[Remarks]

The strcmp function compares the contents of the strings pointed by s1 and s2, and sets up the comparison result as a return value. The rules of comparison are implementation-defined.