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