memchr

Locates the first occurrence of the specified byte within the initial size bytes of a given object.

Format

#include  <string.h>

void *memchr  (const void *s1, int c, size_t
              size);
Function Variants This function also has variants named _memchr32 and _memchr64 for use with 32-bit and 64-bit pointer sizes, respectively. See Section 1.8 for more information on using pointer-size-specific functions.

Arguments

s1
A pointer to the object to be searched.
c
The byte value to be located.
size
The length of the object to be searched.

If size is zero, memchr returns NULL.

Description

Unlike strchr, the memchr function does not stop when it encounters a null character.

Return Values
pointer  A pointer to the first occurrence of the byte. 
NULL  Indicates that the specified byte does not occur in the object. 


Previous Page | Next Page | Table of Contents | Index