programming:c:function strrchrWhat links here?
Defined in string.h.

Find last occurrence of character in string.
Returns the last occurrence of c in string.
The null-terminating character is included as part of the string and can also be searched.

Parameters.

Return Value.

Portability.



 const char * strrchr ( const char * string, int c );
       char * strrchr (       char * string, int c );
Both have the same behavior as the original declaration.

Example.

/* strrchr example */
  1. include
  2. include


int main () { char str[] = "This is a sample string"; char * pch; pch=strrchr(str,'s'); printf ("Last occurence of 's' found at %d \n",pch-str+1); return 0; }


Output: Last occurrence of 's' found at 18

See also.
strchr, strcspn, strcmp, strstr, memchr

From http://www.cplusplus.com/ref/
programming:c:function strrchr
MC6802 - instruction set - Increment stack pointer
programming:c:function ftell
programming - windows - window styles
tk:tk_optionMenu
linux - software
Raspberry PI - GPIO
MC6802 - assembler - statement format
programming:c:struct tm
tk - tk_frame
MC6802 - instruction set - Copy stack pointer to Index Register
MC6802 - instruction set - Copy Index Register to stack pointer
programming - DDE - WinWord DDE Server
code vault - strtail
Raspberry PI - Configure a Raspberry pi zero W without monitor or keyboard
filename:programming:c:function strrchr
filename:programming%3Ac%3Afunction%20strrchr
last edit:March 29 2009 21:08:34 (6256 days ago)
ct = 1778923144.000000 = May 16 2026 05:19:04
ft = 1238375314.000000 = March 29 2009 21:08:34
dt = 540547830.000000