Loading...
Select Version
&pagelevel(4)&pagelevel
Definition | #include <string.h> char *strrchr(const char *s, int c);
The terminating null byte (\0) is treated as a character. | |
Return val. | Pointer to the position of c in string s | |
if successful. | ||
NULL pointer | if c is not contained in string s. | |
Notes | The The following two prototypes of the char *strrchr( char *s, int c); | |
Example | Find the last ’s’: #include <string.h> #include <stdio.h> int main(void) { char *s = "What fun in the ssun!"; printf("%s\n", s); printf("Where is the mistake? %s\n", strrchr(s, 's')); return 0; } | |
See also | index, rindex, strchr |