std::memchr

From Cppreference

Jump to: navigation, search
Defined in header <cstring>

const void *memchr( const void *ptr, int ch, size_t count );

      void *memchr(       void *ptr, int ch, size_t count );

Finds the first occurrence of the byte ch in the memory region pointed to by ptr.

Contents

[edit] Parameters

ptr - pointer to the memory region to be examined
ch - byte to search for
count - number of bytes to examine

[edit] Return value

pointer to the found byte, or NULL if no such byte is found.

[edit] Example

[edit] See also

strchr
finds the first occurrence of a character
(function)