1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <stddef.h> // for NULL #include <string.h> // for strpbrk char *strpbrk(const char *s1, const char *s2) { while (*s1 != '\0') { const char *p = s2; while (*p != '\0') { if (*s1 == *p) return (char *)s1; p++; } s1++; } return NULL; }