Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!