Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2. Contain substring (contain_substring.c) C program has a built-in function strstr(char *s1, char *s2) that can help to find the first occurrence of s2
Problem 2. Contain substring (contain_substring.c) C program has a built-in function strstr(char *s1, char *s2) that can help to find the first occurrence of s2 in s1 if s2 is a substring of s1. Try to implement your own way of doing a similar task as this. Download the attached contain_substring.c file, and finish implementing the isContained(char *s1, char *s2) method. The method will return 1 if s2 is a substring of s1, otherwise return -1. Outputs: Please enter the first string: London bridge is falling down. Please enter the second string: London The second string is a substring of the first string
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started