Question: Consider the function below, that takes a string and a character (called letter) as input: int TaskH (char* word, char letter) { int i
Consider the function below, that takes a string and a character (called letter) as input: int TaskH (char* word, char letter) { int i = 0; int p = -1; while (word [i] if } '\0') { (word[i] == letter) { p = i; } i++; return p; } Which of the following "explain in plain English" descriptions best describes the purpose of this function? Select one: a. Returns true only if the letter occurs exactly once in the string, otherwise returns false O b. Returns the index position of the first occurrence of the letter in the string, or -1 if it doesn't exist C. d. Returns the index position of the last occurrence of the letter in the string, or -1 if it doesn't exist e. Calculates the length of all characters in the string, including letter O f. Returns the index position of the character immediately to the right of letter in the string, or -1 if it doesn't exist Counts how many times the letter occurs in the string g. Returns the index position of the character immediately to the left of letter in the string, or -1 if it doesn't exist Oh. Calculates the length of all characters in the string, excluding letter
Step by Step Solution
3.42 Rating (158 Votes )
There are 3 Steps involved in it
The detailed answer for the above question is provided b... View full answer
Get step-by-step solutions from verified subject matter experts
