Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

memchr - find byte in memory

&pagelevel(4)&pagelevel

Syntax

#include <string.h>

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

Description

memchr() locates the first occurrence of c in the initial n bytes of the memory area pointed
to by s.

s is the pointer to the memory area in which byte c is to be found.

c is the EBCDIC value of the byte to be found.

n is the integer value that specifies the number of bytes to be found in s.

Return val.

Pointer to the position of c in area s



if successful.

 

Null pointer

if c does not occur in the specified area.

Notes

The function is suitable for processing character arrays, which, in contrast to character
strings, need not be terminated by the null byte (\0).

See also

memcmp(), memcpy(), memset(), string.h.