strchr3
String search character
Usage
#include <string.h>
char *strchr(const char *s, int c);
Library
Standard C library (libc, -lc)
Overview
strchr() returns a pointer to the first occurrence of the character c in the string s.
It is equivalent to both of the following expressions:
memchr(s, c, strlen(s) + 1)
strpbrk(s, (char [2]){c, '\0'})
Return value
strchr() returns a pointer to the matched character or NULL if the character is not found.
The terminating null byte is considered part of the string, so that if c is specified as '\0', strchr() returns a pointer to the terminator.
Attributes
For an explanation of the terms used in this section, see attributes(7).
| Interface | Attribute | Value |
| strchr() | Thread safety | MT-Safe |
Releases
19 releases since Debian 1.1 (Buzz); the text changed 13 times.