1MEMCMP(P) POSIX Programmer's Manual MEMCMP(P)
2
3
4
6 memcmp - compare bytes in memory
7
9 #include <string.h>
10
11 int memcmp(const void *s1, const void *s2, size_t n);
12
13
15 The memcmp() function shall compare the first n bytes (each interpreted
16 as unsigned char) of the object pointed to by s1 to the first n bytes
17 of the object pointed to by s2.
18
19 The sign of a non-zero return value shall be determined by the sign of
20 the difference between the values of the first pair of bytes (both
21 interpreted as type unsigned char) that differ in the objects being
22 compared.
23
25 The memcmp() function shall return an integer greater than, equal to,
26 or less than 0, if the object pointed to by s1 is greater than, equal
27 to, or less than the object pointed to by s2, respectively.
28
30 No errors are defined.
31
32 The following sections are informative.
33
35 None.
36
38 None.
39
41 None.
42
44 None.
45
47 The Base Definitions volume of IEEE Std 1003.1-2001, <string.h>
48
50 Portions of this text are reprinted and reproduced in electronic form
51 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
52 -- Portable Operating System Interface (POSIX), The Open Group Base
53 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
54 Electrical and Electronics Engineers, Inc and The Open Group. In the
55 event of any discrepancy between this version and the original IEEE and
56 The Open Group Standard, the original IEEE and The Open Group Standard
57 is the referee document. The original Standard can be obtained online
58 at http://www.opengroup.org/unix/online.html .
59
60
61
62IEEE/The Open Group 2003 MEMCMP(P)