welibc
A clear, secure, and well documented standard C library
Functions
strstr.c File Reference

Defines the strstr function. More...

#include <string.h>
Include dependency graph for strstr.c:

Go to the source code of this file.

Functions

char * strstr (const char *s1, const char *s2)
 Locate the first occurrence of a string in a another string. More...
 

Detailed Description

Defines the strstr function.

Definition in file strstr.c.

Function Documentation

◆ strstr()

char* strstr ( const char *  s1,
const char *  s2 
)

Locate the first occurrence of a string in a another string.

Parameters
*s1String being searched
*s2String being found

The strstr function locates the first occurrence in the string pointed to by s1 of the sequence of characters (excluding the terminating null character) in the string pointed to by s2.

Returns
A pointer to the located string
Return values
NULLThe sequence in s2 was not found in s1

Definition at line 53 of file strstr.c.

References NULL, strchr(), strlen(), and strncmp().

Here is the call graph for this function: