Strings In Depth17 / 18
Up next

strstr

#include <stdio.h>
#include <string.h>

int main(void) {
    const char *hay = "the quick brown fox";
    const char *at = strstr(hay, "brown");
    if (at != nullptr) {
        printf("%s\n", at);
    }
    return 0;
}
What you're solving

find a substring, or NULL