In 7th Edition UNIX™, there were two functions index() and rindex() that are respectively equivalent to the standard C functions strchr() and strrchr(), give or take const (which didn't exist when those functions were defined, any more than prototypes existed; there wasn't even C with Classes back then).

You're running foul of the backwards-compatible declarations of the function rindex(). The names index() and rindex() are archaic, but you can't use them blithely in your own code. Choose a different function name.

Answer from Jonathan Leffler on Stack Overflow
🌐
Linux Man Pages
linux.die.net › man › 3 › rindex
rindex(3): locate char in string - Linux man page
The rindex() function returns a pointer to the last occurrence of the character c in the string s.
🌐
MKSSoftware
mkssoftware.com › docs › man3 › rindex.3.asp
rindex() -- search for character in string
Is the character to search for. ... rindex() returns a pointer to the last occurrence of character c in string s.
🌐
Lemoda
nxmnpg.lemoda.net › 3 › rindex
rindex(3) manual page
The terminating null character is considered part of the string; therefore if c is ‘\0’, the functions locate the terminating ‘\0’. The rindex() function is identical to index(), except it locates the last occurrence of c.
🌐
IBM
ibm.com › docs › SSLTBW_2.4.0 › com.ibm.zos.v2r4.bpxbd00 › rrindx.htm
rindex() — Search for character - IBM Documentation
June 25, 2021 - If successful, rindex() returns a pointer to the first occurrence of c (converted to an unsigned character) in the string pointed to by string.
🌐
The Open Group
pubs.opengroup.org › onlinepubs › 009695399 › functions › rindex.html
rindex
The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition Copyright © 2001-2004 The IEEE and The Open Group, All Rights reserved. ... The rindex() function shall be equivalent to strrchr().
Find elsewhere
🌐
NetBSD
man.netbsd.org › rindex.3
rindex(3) - NetBSD Manual Pages
RINDEX(3) NetBSD Library Functions ... char * rindex(const char *s, int c); DESCRIPTION The rindex() function locates the last character matching c (converted to a char) in the nul-terminated string s....
🌐
CS50
manual.cs50.io › 3 › rindex
rindex - CS50 Manual Pages
index, rindex - locate character in string · Standard C library (libc, -lc) #include <strings.h> [[deprecated]] char *index(const char *s, int c); [[deprecated]] char *rindex(const char *s, int c); index() is identical to strchr(3). rindex() is identical to strrchr(3).
🌐
Linux Man Pages
man7.org › linux › man-pages › man3 › rindex.3.html
index(3) - Linux manual page
November 1, 2020 - index, rindex - locate character in string · Standard C library (libc, -lc) #include <strings.h> [[deprecated]] char *index(const char *s, int c); [[deprecated]] char *rindex(const char *s, int c); index() is identical to strchr(3). rindex() is identical to strrchr(3).
🌐
Polytechnique
lix.polytechnique.fr › ~liberti › public › computing › prog › c › C › MAN › index.htm
index - LIX
The index() function returns a pointer to the first occur- rence of the character c in the string s. The rindex() function returns a pointer to the last occur- rence of the character c in the string s.
🌐
FreeBSD
man.freebsd.org › cgi › man.cgi
rindex(3)
Community · Mailing Lists · Forums ... char *s, int c); char * rindex(const char *s, int c); DESCRIPTION The index() function locates the first occurrence of c (converted to a char) in the string pointed to by s....
🌐
Oracle
docs.oracle.com › cd › E88353_01 › html › E37843 › rindex-3c.html
rindex - man pages section 3: Basic Library Functions
February 9, 2022 - The rindex() function returns a pointer to the last occurrence of character c in string s.
🌐
R Project
search.r-project.org › CRAN › refmans › dynpred › html › cindex.html
R: Calculate Harrell's c-index
This function calculates Harrell's c-index · Formula for prediction model to be used as in coxph
🌐
Hexmos
hexmos.com › freedevtools › man-pages › library-functions › string-examination › index-rindex
index, rindex - locate character in string - Manual Page | Free DevTools by Hexmos
Standard C library ( libc, -lc) index, rindex - locate character in string · strchr(3), strrchr(3) Linux man-pages 6.9.1 2024-05-02 · index(3) None. #include<strings.h>[[deprecated]]char*index(constchar* s,int · c);[[deprecated]]char*rindex(constchar* s,int ·
🌐
GitHub
github.com › eblot › newlib › blob › master › newlib › libc › string › rindex.c
newlib/newlib/libc/string/rindex.c at master · eblot/newlib
Sourceware.org's Newlib mirror with clang support for ARM baremetal - newlib/newlib/libc/string/rindex.c at master · eblot/newlib
Author: eblot
🌐
W3Schools
w3schools.com › python › ref_string_rindex.asp
Python String rindex() Method
The rindex() method raises an exception if the value is not found.
🌐
RDocumentation
rdocumentation.org › packages › intsurv › versions › 0.2.2 › topics › cIndex
cIndex function - RDocumentation
A numeric vector for event indicators. If it is NULL (by default) or NA, event will be treated all as ones and the function will compute concordance index for uncensored survival data.