Question: Name: find_word (C++) 2 Arguments: a character array (the message), and another character array for the query (a sequence that is the word we will

Name: find_word (C++)

2 Arguments: a character array (the message), and another character array for the query (a sequence that is the word we will try to find).

Return: the first index where the query can be found in the message. Return the index of the null byte if the query is not found in that range.

Example: if the first character sequence is "hello is a short greeting", and the second character sequence is "short", and we call find_word("hello is a short greeting", "short"); then we return 11.

As usual, add code in main() to check that the function seems to work. Your program should output the following for the above example. The autograder will be looking for this output (make sure your output includes the single quotes):

The first instance of short in the phrase hello is a short greeting begins at index 11.

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!