Namespaces
Variants
Views
Actions

Difference between revisions of "c/string/byte/strstr"

From cppreference.com
< c‎ | string‎ | byte
m (Text replace - "example cpp" to "example c")
m (Text replace - "{{cpp|" to "{{c|")
Line 21: Line 21:
 
===Return value===
 
===Return value===
  
pointer to the first character of the found substring in {{tt|dest}}, or {{cpp|NULL}} if no such character is found. If {{tt|src}} points to an empty string, {{tt|dest}} is returned.
+
pointer to the first character of the found substring in {{tt|dest}}, or {{c|NULL}} if no such character is found. If {{tt|src}} points to an empty string, {{tt|dest}} is returned.
  
 
===Example===
 
===Example===

Revision as of 16:33, 13 April 2012

Template:c/string/byte/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <string.h>
</td>

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

<td class="t-dcl-nopad">
const char *strstr( const char *dest, const char *src );
</td>

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

<td class="t-dcl-nopad">
char *strstr(       char *dest, const char *src );
</td>

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

Finds the first occurrence of the byte string src in the byte string pointed to by dest.

Contents

Parameters

dest - pointer to the null-terminated byte string to examine
src - pointer to the null-terminated byte string to search for

Return value

pointer to the first character of the found substring in dest, or NULL if no such character is found. If src points to an empty string, dest is returned.

Example

Template:example c

See also

Template:c/string/byte/dcl list strchrTemplate:c/string/byte/dcl list strrchr