HP C/iX Library Reference Manual (30026-90004)
254 Chapter5
HP C/iX Library Function Descriptions
memchr
memchr
Searches memory for a specified character.
Syntax
#include <string.h>
void *memchr(const void *
s
, int
c
, size_t
n
);
Parameters
s
A pointer to the object to search.
c
The character value to find in the object.
n
The maximum number of characters to examine.
Return Values
x A pointer to the first occurrence of the character. If the character
c
is not
found, a null pointer is returned.
Description
The memchr function returns a pointer to the first occurrence of character
c
in the object
pointed to by
s
. Only the first
n
characters of the
s
array are examined. This function does
not terminate when a null character is encountered. Each character is treated as an
unsigned character.
See Also
memcpy(), memcmp(), memmove(), memset(), ANSI C 4.11.5.1