strrchr function(Search String in Reverse for Character) in C Language – example and detail

In the C Programming Language, the strrchr characteristic searches within the string pointed to by way of s for the closing occurrence of the character c. It returns a pointer to it.


The syntax for the strrchr function in the C Language is:

char *strrchr(const char *s, int c);

Parameters or Arguments

s A string (terminated by using a null character). c The persona to be found.


The strrchr function returns a pointer to the ultimate occurrence of the personality c within the string pointed to by way of s. If c is not found, it returns a null pointer.

Required Header

In the C Language, the required header for the strrchr function is:

#include <string.h>

Applies To

In the C Language, the strrchr characteristic can be used in the following versions:

ANSI/ISO 9899-1990

See Also

Other C features that are noteworthy when dealing with the strrchr function:

memchr characteristic strchr characteristic strpbrk function strstr feature