memcmp3
Compare byte string
Usage
#include <string.h>
int
memcmp(const void *s1, const void *s2, size_t n);
Library
Standard C Library (libc, -lc)
Overview
The memcmp() function compares byte string s1 against byte string s2. Both strings are assumed to be n bytes long.
Return values
The memcmp() function returns zero if the two strings are identical, otherwise returns the difference between the first two differing bytes (treated as unsigned char values, so that ‘\200’ is greater than ‘\0’, for example). Zero-length strings are always identical. This behavior is not required by C and portable code should only depend on the sign of the returned value.
Releases
163 releases since Mac OS X 10.0; the text changed 4 times.