---
name: "rpmatch"
section: "3"
platform: "macos"
package: "Libc"
version: "1752.120.2"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/rpmatch"
---

# rpmatch(3)

determine whether the response to a question is affirmative or negative

## NAME

**rpmatch** – determine whether the response to a question is affirmative or negative

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<stdlib.h\>**

*int*\

**rpmatch**(*const char \*response*);

## DESCRIPTION

The **rpmatch**() function determines whether the *response* argument is an affirmative or negative response to a question according to the current locale.

## RETURN VALUES

The **rpmatch**() functions returns:

- 1

  The response is affirmative.

- 0

  The response is negative.

- \-1

  The response is not recognized.

## SEE ALSO

[nl\_langinfo(3)](/nl_langinfo/3.md), [setlocale(3)](/setlocale/3.md)

## HISTORY

The **rpmatch**() function appeared in macOS 10.15.
