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

Defines the strchr function. More...

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

Go to the source code of this file.

Functions

char * strchr (const char *s, int c)
 Locate the first occurrence of a character in a string. More...
 

Detailed Description

Defines the strchr function.

Definition in file strchr.c.

Function Documentation

◆ strchr()

char* strchr ( const char *  s,
int  c 
)

Locate the first occurrence of a character in a string.

Parameters
*sString being searched
cCharacter to find

The strchr function locates the first occurrence of c (converted to a char) in the string pointed to by s. The terminating null character is considered to be a part of the string.

Returns
A pointer to the located character
Return values
NULLThe character does not occur in the string

Definition at line 53 of file strchr.c.

References NULL.

Referenced by strcspn(), strspn(), and strstr().

Here is the caller graph for this function: