XINU
strrchr.c
Go to the documentation of this file.
1 
13 char *strrchr(const char *s, int c)
14 {
15  char *r = 0;
16 
17  for (; *s != '\0'; s++)
18  {
19  if (*s == (const char)c)
20  {
21  r = (char *)s;
22  }
23  }
24 
25  if ((const char)c == *s)
26  {
27  return (char *)s;
28  }
29 
30  return r;
31 }
char * strrchr(const char *s, int c)
文字列の後方から指定された文字を探し、最後に見つかった位置をポインタで返す。
Definition: strrchr.c:13