my previous version was wrong; this one is right
[unix-history] / usr / src / lib / libc / string / memcmp.3
CommitLineData
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
14memcmp \- compare byte string
15.SH SYNOPSIS
16.nf
17.ft B
18#include <string.h>
19
20int
21memcmp(const void *b1, const void *b2, size_t len);
22.ft R
23.fi
24.SH DESCRIPTION
25.B Memcmp
26compares byte string
27.I b1
28against byte string
29.IR b2 ,
30returning zero if they are identical,
31otherwise returning the difference between the first two differing bytes
32(treated as unsigned char values, so that '\e200' is greater than \&'\e0',
33e.g.).
34Both strings are assumed to be
35.I len
36bytes long.
37Zero-length strings are always identical.
38.SH SEE ALSO
b8dfab23 39bcmp(3), strcasecmp(3), strcmp(3), strcoll(3), strxfrm(3)
90f51bbb
KB
40.SH STANDARDS
41.I Memcmp
42conforms to ANSI X3.159-1989 (``ANSI C'').