shithub: scc

ref: 08a32f26c08c322c5549b94c05032d2e87f1df3c
dir: /doc/man3/memchr.3/

View raw version
.TH memchr 3
.SH NAME
memchr - find byte in memory
.SH SYNOPSIS
#include <string.h>

void *memchr(const void *s, int c, size_t n)
.SH DESCRIPTION
The
.BR memchr ()
function locates the first occurence of
.I c
(converted to an unsigned char)
in the initial
.I n
characters
(each interpreted as unsigned char)
of the object pointed to by
.IR s .
.PP
The function shall not try to locate
.I c
if
.I n
is equal to 0.
.SH RETURN VALUE
The
.BR memchr ()
function shall return a pointer to the located character
or a null pointer if the character does not occur in the object.
.SH STANDARDS
ISO/IEC 9899:1999 Section 7.21.5.1