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
programming:c:function feof
programming:c:format string flags
programming - C - function isxdigit
AutoCAD - Dialog Control Language (DCL) - button
programming:c:function getc
programming:c:function strncpy
X Windows Structures - XButtonEvent
programming:c:function islower
programming - C - struct stat
programming:c:function fopen
programming - windows - GetWindowLong
programming:c:function strcpy
programming:c:function fclose
programming:c:function substr
programming - C - function strnpos
programming:c:function fputc
X Windows Structures - XKeyEvent
filename:programming - C - function strrchr
filename:programming%20%2D%20C%20%2D%20function%20strrchr
last edit:March 30 2009 01:08:34 (6436 days ago)
ct = 1794509845.000000 = November 12 2026 18:57:25
ft = 1238375314.000000 = March 30 2009 01:08:34
dt = 556134531.000000