A C library function which searches for the first occurrence of a character in a string.
strchr
is a C library function found in the header string.h
. The declaration for it is
char *strchr(const char *str, int c)
This function searches for the first occurrence of the character c
(an unsigned char
) in the string pointed to by the argument str
. It returns a pointer to the first occurrence of the character c
in the string str
, or NULL
if the character is not found.