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);
1 – Function Variants
The memchr function has variants named _memchr32 and _memchr64
for use with 32-bit and 64-bit pointer sizes, respectively.
2 – 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.
3 – Description
Unlike strchr, the memchr function does not stop when it
encounters a null character.
4 – Return Values
pointer A pointer to the first occurrence of the byte.
NULL Indicates that the specified byte does not
occur in the object.