Go to the first, previous, next, last section, table of contents.


rindex

Syntax

#include <strings.h>

char *rindex(const char *string, int ch);

Description

Returns a pointer to the last occurrence of ch in string. Note that the NULL character counts, so if you pass zero as ch you'll get a pointer to the end of the string back.

Return Value

A pointer to the character, or NULL if it wasn't found.

Portability

not ANSI, not POSIX

Example

char *last_slash = rindex(filename, '/');


Go to the first, previous, next, last section, table of contents.