Namespaces
Variants
Views
Actions

std::memchr

From cppreference.com
< cpp‎ | string‎ | byte
Revision as of 17:31, 2 November 2012 by P12bot (Talk | contribs)

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <cstring>
</td>

<td></td> <td></td> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td class="t-dcl-nopad">
const void* memchr( const void* ptr, int ch, std::size_t count );
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td class="t-dcl-nopad">
      void* memchr(       void* ptr, int ch, std::size_t count );
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

Converts ch to unsigned char and locates the first occurrence of that value in the initial count characters (each interpreted as unsigned char) of the object pointed to by ptr.

Contents

Parameters

ptr - pointer to the object to be examined
ch - character to search for
count - number of characters to examine

Return value

Pointer to the location of the character, or NULL if no such character is found.

Example

See also

Template:cpp/string/byte/dcl list strchrTemplate:cpp/algorithm/dcl list find
C documentation for memchr