Keil Logo Arm Logo

CARM User's Guide

Discontinued

strrchr

Summary
#include <string.h>

unsigned char *strrchr (
  const unsigned char *string,   /* string to search */
  char c);                       /* character to find */
Description

The strrchr function searches string for the last occurrence of c. The null character terminating string is included in the search.

Return Value

The strrchr function returns a pointer to the last character c found in string or a null pointer if no matching character was found.

See Also

strchr, strcspn, strpbrk, strpos, strrpbrk, strrpos, strspn

Example
#include <string.h>
#include <stdio.h> /* for printf */

void tst_strrchr (void) {
  unsigned char *s;
  unsigned char buf [] = "This is a test";

  s = strrchr (buf, 't');

  if (s != NULL)
    printf ("found the last 't' at %s\n", s);
}

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.