/************************************** this example uses the strstr function to check if str2 appears in str1 ***************************************/ #include #include int main(void) { char *str1 = "programmershelp.co.uk c section"; char *str2 = "section"; char *substring; /*check to see if str2 is in str1*/ substring = strstr(str1,str2); if (substring != NULL) printf("%s\n",substring); return 0; }