Everything

memcmp


Compares the contents of two storage areas specified.

[Format]

#include <string.h>

long memcmp (const void *s1, const void *s2, size_t n);

[Parameters]

s1 Pointer to the reference storage area to be compared

s2 Pointer to the storage area to compare to the reference

n Number of characters to compare

[Return values]

If storage area pointed by s1 > storage area pointed by s2: Positive value

If storage area pointed by s1 == storage area pointed by s2: 0

If storage area pointed by s1 < storage area pointed by s2: Negative value

[Remarks]

The memcmp function compares the contents of the first n characters in the storage areas pointed by s1 and s2. The rules of comparison are implementation-defined.