CONFORMING TO
4.3BSD; marked as LEGACY in POSIX.1-2001. POSIX.1-2008 removes the specifications of index() and rindex(), recommending strchr(3) and strrchr(3) instead.
The rindex and strrchr functions are identical:
char *strrchr(const char *s, int c);
The strrchr() function returns a pointer to the last occurrence of the character c in the string s.
char *rindex(const char *s, int c);
The rindex() function returns a pointer to the last occurrence of the character c in the string s.
rindex
is deprecated:The
rindex
andstrrchr
functions are identical: