MEMRCHR(3)

NAME
memrchr - reverse search for character in memory

SYNOPSIS

#include <string.h>

void *memrchr(const void *src, int c, size_t length);

DESCRIPTION

This function searches memory starting at length bytes beyond *src backwards for the character c. The search only ends with the first occurrence of c; in particular, NUL does not terminate the search.

RETURNS

If the character c is found within length characters of *src, a pointer to the character is returned. If c is not found, then NULL is returned.

PORTABILITY

memrchr is a GNU extension.

memrchr requires no supporting OS subroutines.