shithub: scc

ref: cb1b6c86fe82527f4c3c5f8f11ea4f5e4ae6a350
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