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

# streq(3)

strings equal

## NAME

streq - strings equal

## LIBRARY

gnulib - The GNU Portability Library

## SYNOPSIS

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

**bool streq(const char \****s1***, const char \****s2***);**

## DESCRIPTION

**streq**() determines whether the strings *s1* and *s2* are equal, as if by calling [**memeq**(3)](/memeq/3.md).

It is equivalent to both of the following expressions:

```
strcmp(s1, s2) == 0
memeq(s1, s2, MIN(strlen(s1),strlen(s2))+1)
```

## RETURN VALUE

See [**memeq**(3)](/memeq/3.md).

## ATTRIBUTES

For an explanation of the terms used in this section, see [**attributes**(7)](/attributes/7.md).

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

## STANDARDS

GNU.

## HISTORY

gnulib 202601.

## SEE ALSO

[**string**(3)](/string/3.md)
