---
name: "strchr"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/strchr"
---

# strchr(3)

string search character

## NAME

strchr - string search character

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <string.h>
```

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

## DESCRIPTION

**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)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **strchr**() | Thread safety | MT-Safe |

## STANDARDS

C11, POSIX.1-2008.

## HISTORY

POSIX.1-2001, C89, SVr4, 4.3BSD.

## SEE ALSO

[**memchr**(3)](/memchr/3.md), [**string**(3)](/string/3.md), [**strchrnul**(3)](/strchrnul/3.md), [**strnul**(3)](/strnul/3.md), [**strpbrk**(3)](/strpbrk/3.md), [**strrchr**(3)](/strrchr/3.md), [**strsep**(3)](/strsep/3.md), [**strspn**(3)](/strspn/3.md), [**strstr**(3)](/strstr/3.md), [**wcschr**(3)](/wcschr/3.md),
