3 /* strrchr( const char *, int c )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
13 char * strrchr( const char * s, int c )
19 if ( s[--i] == (char) c )
21 return (char *) s + i;
30 #include <_PDCLIB_test.h>
34 char abccd[] = "abccd";
35 TESTCASE( strrchr( abcde, '\0' ) == &abcde[5] );
36 TESTCASE( strrchr( abcde, 'e' ) == &abcde[4] );
37 TESTCASE( strrchr( abcde, 'a' ) == &abcde[0] );
38 TESTCASE( strrchr( abccd, 'c' ) == &abccd[3] );