+ Explanationhe function strstr() Finds the first occurrence of a substring in another stringDeclaration: char *strstr(const char *s1, const char *s2);Return Value:
On success, strstr returns a pointer to the element in s1 where s2 begins (points to s2 in s1).
On error (if s2 does not occur in s1), strstr returns null.Example:#include #include int main(void)
{
char *str1 = "VCampus", *str2 = "mp", *ptr;
ptr = strstr(str1, str2);
printf("The substring is: %sn", ptr);
return 0;
}
Output: The substring is: mpus