4
answers
2
watching
381
views

Check Substring You are given two strings s1 and s2. Write a function isSubstring(char s1[], char s2[]) which takes two strings as input, and returns the start index if the second string is a substring of the first, else returns -1. (Case Insensitive) Note: Print the result in the main() function. 4.1

Example 4.1.1

Input:

Starfish

Star

Output: 0

4.1.2

Input:

Starfish

Fish

Output:

4

4.1.3

Input:

Exhibition

habit

Output:

-1

For unlimited access to Homework Help, a Homework+ subscription is required.

Unlock all answers

Get 1 free homework help answer.
Already have an account? Log in
Avatar image
Read by 4 people
Already have an account? Log in
Avatar image
Read by 4 people
Already have an account? Log in
Avatar image
Read by 4 people
Already have an account? Log in

Related questions

Weekly leaderboard

Start filling in the gaps now
Log in