1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\" May be distributed under the GNU General Public License
.\" References consulted:
.\" Linux libc source code
.\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
.\" 386BSD man pages
.\" Modified Mon Apr 12 12:49:57 1993, David Metcalfe
.\" Modified Sat Jul 24 18:56:22 1993, Rik Faith (faith@cs.unc.edu)
.TH MEMCHR 3 "April 12, 1993" "GNU" "Linux Programmer's Manual"
.SH NAME
memchr \- scan memory for a character
.SH SYNOPSIS
.nf
.B #include <string.h>
.sp
.BI "void *memchr(const void *" s ", int " c ", size_t " n );
.fi
.SH DESCRIPTION
The \fBmemchr()\fP function scans the first \fIn\fP bytes of the memory
area pointed to by \fIs\fP for the character \fIc\fP. The first byte to
match \fIc\fP (interpreted as an unsigned character) stops the operation.
.SH "RETURN VALUE"
The \fBmemchr()\fP function returns a pointer to the matching byte or
NULL if the character does not occur in the given memory area.
.SH "CONFORMING TO"
SVID 3, BSD 4.3, ISO 9899
.SH SEE ALSO
.BR index "(3), " rindex "(3), " strchr "(3), " strpbrk (3),
.BR strrchr "(3), " strsep "(3), " strspn "(3), " strstr (3)
|