memchr(3)

memchr3

Locate byte in byte string

Usage

#include <string.h>

void *

memchr(const void *s, int c, size_t n);

Library

Standard C Library (libc, -lc)

Overview

The memchr() function locates the first occurrence of c (converted to an unsigned char) in string s.

Return values

The memchr() function returns a pointer to the byte located, or NULL if no such byte exists within n bytes.

Releases

163 releases since Mac OS X 10.0; the text changed 3 times.

  1. 10.0–10.1.5
  2. 10.2–10.4.11
  3. 10.5–10.6.8
  4. 10.7–26.5

Standards

The memchr() function conforms to ISO/IEC 9899:1990 (“ISO C90”).

From Libc 1752.120.2 in macOS 26.5. Parsed by carta from the page's mdoc source.