1 2 3 4 5 6 7 8 9 10 11
#include <string.h> char * strchr(const char * s, int c) { while (*s != NULL && *s != c) { s++; } if (*s == c) { return (char *)s; } return NULL; }