Namespaces
Variants
Views
Actions

std::strchr

From cppreference.com
< cpp‎ | string‎ | byte
Revision as of 17:04, 24 November 2012 by Cubbi (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 char* strchr( const char* str, int ch );
</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">
      char* strchr(       char* str, int ch );
</td>

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

Finds the first occurrence of the character ch in the byte string pointed to by str.

Contents

Parameters

str - pointer to the null-terminated byte string to be analyzed
ch - character to search for

Return value

Pointer to the found character in str, or NULL if no such character is found.

Example

See also

Template:cpp/string/basic string/dcl list findTemplate:cpp/string/wide/dcl list wcschrTemplate:cpp/string/byte/dcl list strrchrTemplate:cpp/string/byte/dcl list strpbrk
C documentation for strchr