Embedded Artistry Framework
Embedded Systems C++ Framework
Functions
strstr.c File Reference
#include <string.h>
Include dependency graph for strstr.c:

Functions

char * strstr (const char *string, const char *substring)
 Finds the first occurrence of the substring in the string. More...
 

Function Documentation

◆ strstr()

char* strstr ( const char *  string,
const char *  substring 
)

Finds the first occurrence of the substring in the string.

Finds the first occurrence of the null-terminated byte string pointed to by substring in the null-terminated byte string pointed to by string. The terminating null characters are not compared.

The behavior is undefined if either stirng or substring is not a pointer to a null-terminated byte string.

Parameters
stringpointer to the null-terminated byte string to examine
substringpointer to the null-terminated byte string to search for
Returns
Pointer to the first character of the found substring in string, or NULL if no such substring is found. If substring points to an empty string, string is returned.

References a, b, and NULL.