Question: use C++ language search substring in the str(string) and return the index from where it starts. DO NOT use any library functions. int search_substring(std::string& sub,
use C++ language


search substring in the str(string) and return the index from where it starts. DO NOT use any library functions. int search_substring(std::string& sub, std::string& str); package this above function in a separate file and call it from your main program and link it separately at compile time let us say you wrote your function search_substring() in ss.cpp g++ -C SS.cpp above call will create object file main.cpp is main program g++ -omain main.cpp ss.o Example: str = "This is my computer"; sstr = "my" int i = search_substring(sstr, str); i should 8 in this case. #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
