Question: Write the definition of a recursive function named find that is passed a c-string and a char and returns with the pos of the char

Write the definition of a recursive function named find that is passed a c-string and a char and returns with the pos of the char if it finds the char within the c-string or returns -1 if the char is not found. For example, if a c-string named str containing the value this is my string and a char named c containing the value i is passed in to find, the function should return the value 2. However, if c contained the value a, then find would return -1. This is what the function call for the example above would look like: int foundAt = find(str, c); NOTE: This function takes a c-string, NOT a string. NOTE: No points will be awarded if you include a loop construct within your solution.

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!