Standard C Functions


strrchr


Syntax

#include <string.h>
char *strrchr(const char *str, int c)

Arguments

str      character string to be searched
c        character code of the character to be found

Return Value

A pointer to the last occurrence of c within string or a NULL if c is not found in string

Description

Finds the last occurrence of c within string by searching from right to left, and then either returns a pointer to that found character in the string or returns a NULL if the character is not found.