Commit | Line | Data |
---|---|---|
90f51bbb KB |
1 | .\" Copyright (c) 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" This code is derived from software contributed to Berkeley by | |
5 | .\" Chris Torek. | |
6 | .\" | |
7 | .\" %sccs.include.redist.man% | |
8 | .\" | |
b8dfab23 | 9 | .\" @(#)memcmp.3 5.2 (Berkeley) %G% |
90f51bbb KB |
10 | .\" |
11 | .TH MEMCMP 3 "" | |
12 | .UC 7 | |
13 | .SH NAME | |
14 | memcmp \- compare byte string | |
15 | .SH SYNOPSIS | |
16 | .nf | |
17 | .ft B | |
18 | #include <string.h> | |
19 | ||
20 | int | |
21 | memcmp(const void *b1, const void *b2, size_t len); | |
22 | .ft R | |
23 | .fi | |
24 | .SH DESCRIPTION | |
25 | .B Memcmp | |
26 | compares byte string | |
27 | .I b1 | |
28 | against byte string | |
29 | .IR b2 , | |
30 | returning zero if they are identical, | |
31 | otherwise returning the difference between the first two differing bytes | |
32 | (treated as unsigned char values, so that '\e200' is greater than \&'\e0', | |
33 | e.g.). | |
34 | Both strings are assumed to be | |
35 | .I len | |
36 | bytes long. | |
37 | Zero-length strings are always identical. | |
38 | .SH SEE ALSO | |
b8dfab23 | 39 | bcmp(3), strcasecmp(3), strcmp(3), strcoll(3), strxfrm(3) |
90f51bbb KB |
40 | .SH STANDARDS |
41 | .I Memcmp | |
42 | conforms to ANSI X3.159-1989 (``ANSI C''). |