Question: C++ A substring refers to a string that is a continuous segment of a larger string. The list of all substrings of the string apple

 C++ A substring refers to a string that is a continuous

C++

A substring refers to a string that is a continuous segment of a larger string. The list of all substrings of the string "apple" would be: "apple "appl, "pple" "app", "ppl, "ple" Write a function that takes in a long string and a candidate substring and returns the number of times the substring occurred in the longer string Your function should take two parameters in this order: o a string parameter for the substring a string parameter for the longer string Your function should return the number of times the substring occurs in the string Your function should not print anything Your function MUST be named getMatchCount Examples: "si, "mississippi" 2 "ipp", "mississippi" >1 Edge cases: Make sure your function can handle the following edge cases: substring is empty->return-1 string is empty return- substring is longer than string >return-2

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!