strrchr : strrchr « string.h « C Tutorial






ItemValue
Header filestring.h
Declarationchar *strrchr(const char *str, int ch);
Returnreturns a pointer to the last occurrence of ch in *str.


If no match is found, a null pointer is returned.

#include <string.h>
  #include <stdio.h>

  int main(void){
    char *p;

    p = strrchr("this is a test", 'i');
    printf(p);

    return 0;
  }
is a test








24.18.strrchr
24.18.1.strrchr
24.18.2.Using strchr