/* string library functions */ /* 'strstr' searches for a substring in a string */ #include #include int main() { char string1[] = "computers are complicated machines"; char *str_ptr; printf("Our string is: %s\n", string1); printf("Searching for 'comp' in the string...\n"); str_ptr = strstr(string1, "comp"); if (str_ptr != NULL) printf("%s\n", str_ptr); printf("Now we'll search for 'eletr'...\n"); str_ptr = strstr(string1, "eletr"); if (str_ptr != NULL) printf("%s\n", strstr(string1, "eletr")); }