Question: Complete the function GetLastIndex ( ) that has one string parameter and one character parameter. The function returns the index of the last character in

Complete the function GetLastIndex() that has one string parameter and one character parameter. The function returns the index of the last character in the string that is not equal to the character parameter. If no such character is found, the function returns \(-1\).
Ex: If the input is hwvww w, then the output is:
```
2
```
```
#include
using namespace std;
int GetLastIndex(string inputString, char x){
/* Your code goes here */
}
int main(){
string inString;
char x;
int result;
cin >> inString;
cin >> x;
```
```
2
3
```
Complete the function GetLastIndex ( ) that has

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!