strrchr is function in string.h. It is mainly used to locate last occurrence of character in string, searching from the end. It returns a pointer to the last occurrence of character in the C string str. The terminating null-character is considered part of the C string. Therefore, it can also be located to retrieve a pointer to the end of a string.
== Syntax ==
In C, this function is declared as:
char *strrchr ( const char *, int );
str is a C string.
character is the character to be located. It is passed as its int promotion, but it is internally converted back to char.
== Return value ==
A pointer to the last occurrence of character in str.
If the value is not found, the function returns a null pointer.
== Example ==
Output : Last occurrence of 's' found at 18.
== See also ==
== References ==
== External links ==
some information about strchrnul
C++ reference for std::strrchr