13 lines
170 B
C
13 lines
170 B
C
|
#include <string.h>
|
||
|
|
||
|
char *strrchr(char const *s, int c)
|
||
|
{
|
||
|
void *last = NULL;
|
||
|
|
||
|
for(size_t i = 0; s[i]; i++) {
|
||
|
if(s[i] == c) last = (void *)&s[i];
|
||
|
}
|
||
|
|
||
|
return last;
|
||
|
}
|