---
name: "ustrchr"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/ustrchr"
---

# ustrchr(3alleg)

Finds the first occurrence of a character in a string. Allegro game programming library.

## NAME

ustrchr - Finds the first occurrence of a character in a string. Allegro game programming library.

## SYNOPSIS

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

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

## DESCRIPTION

Finds the first occurrence of the character \`c' in the string \`s'. Example:

```
   char *p = ustrchr("one,two,three,four", ',');
```

## RETURN VALUE

Returns a pointer to the first occurrence of \`c' in \`s', or NULL if no match was found. Note that if \`c' is NULL, this will return a pointer to the end of the string.

## SEE ALSO

[**uconvert**(3alleg)](/uconvert/3alleg.md), [**ustrrchr**(3alleg)](/ustrrchr/3alleg.md), [**ustrstr**(3alleg)](/ustrstr/3alleg.md), [**ustrpbrk**(3alleg)](/ustrpbrk/3alleg.md), [**ustrtok**(3alleg)](/ustrtok/3alleg.md)
