Question: Write the function numStr() in C++.The function has two parameters: a const char * s1 pointing to the first character in a C-style string, and
Write the function numStr() in C++.The function has two parameters: a const char * s1 pointing to the first character in a C-style string, and a const char * s2. Return the number of times that s2 appears inside s1. */
**You may not use ANY library functions or include any headers, except for
Example:
Calling:
numStr("abaracadabara", "a"); prints 7. numStr("abaracadabara", "ab"); prints 2. numStr("abaracadabara", "bara"); prints 2 numStrK("abaracadabara", "cad"); prints 1 numStr("abaracadabara", "A"); prints 0
Please explain your steps. Thanks.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
