Recursion function

I have the function
 
bool find(string s, string t)


that test whether the string t is contained in the string s
For instance, if I call the function like

 
bool b = find("Mississippi", "sip");


it should return ture as "sip" is in "Mississippi" ..
Please help. I need to use recursion here
Last edited on
If t.size() < s.size() return false,
else if first t.size() chars of s are the same as t, return true,
else check whether you can find t in the characters of s minus the first one.
You'll probably want to use http://cplusplus.com/reference/string/string/substr/
thank you!
Topic archived. No new replies allowed.