|
|
#include <strings.h>char *index(const char *s, int c);
char *rindex(const char *s, int c);
These functions operate on NULL-terminated strings. They do not check for overflow of any receiving string.
index and rindex return a pointer to the first (last) occurrence of character c in string s, or a NULL pointer if c does not occur in the string. The NULL character terminating a string is considered to be part of the string.