rindex

Locates the last occurrence of a specified character in a string.

Library:LibC
Classification:POSIX (Legacy)
Service:Characters and Strings

Syntax

  #include <string.h> 
   
  char *rindex (
     const char   *s,
     int           c);
  

Parameters

s

(IN) Points to the string containing characters to be searched.

c

(IN) Specifies the character to locate.

Return Values

Returns a pointer to the located character or a NULL pointer if the character does not occur in the string.

Remarks

The rindex interface has been implemented as a macro. The strrchr function is the preferred interface.

See Also