Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

=+Creative strategy statement template Example

Answered: 1 week ago