Question: 4. Write a function named findLastCharacter that takes a C-string and a character as arguments and returns the last index of the character in the

 4. Write a function named findLastCharacter that takes a C-string and

4. Write a function named findLastCharacter that takes a C-string and a character as arguments and returns the last index of the character in the C-string if the character is found in the C-string; otherwise returns -1. For example, if char S[ ] = "massachusettes"; and char chl = 's', ch2 = 'c'; then The function call findLastCharacter(S, ch1) must return 14. The function call findLastCharacter(S, ch2) must return 5

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 Programming Questions!