Question: Please use C++ to code and follow the comment: Exercise P10.6. Use recursion to implement a function int index_of (string s, string t) that returns
Please use C++ to code and follow the comment:


Exercise P10.6. Use recursion to implement a function int index_of (string s, string t) that returns the starting position of the first substring of the string s that matches t. Return-1 if t is not a substring of s. For example, int n - s.index_of("Mississippi!", "sip"); // Returns 6 Hint: This is a bit trickier than Exercise P10.5, because you need to keep track of how far the match is from the beginning of the sentence. Make that value a parame- ter of a helper function. S1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
