memrchr—reverse search for character in memory #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
*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.