-
strrchr
Hi everyone,
Does anyone know why the old C function "strrchr" has been implemented in C++ as
Code:
const char * strrchr ( const char * str, int character );
char * strrchr ( char * str, int character );
and not as
Code:
char * strrchr ( const char *, int );
Some old C libraries won't compile anylonger...
Thanks!
-
strrchr returns a pointer to the character found (or a null pointer otherwise). As such, it makes sense that if you pass it a pointer to something that should not be changed, you get back a pointer to something that should not be changed.