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