Page 1 of 1

Consider the following function: int more_recursive_fun(const char *s, char t) { if (s[0] == '\0') { return 0; } else if

Posted: Sat May 14, 2022 3:53 pm
by answerhappygod
Consider the following function:
int more_recursive_fun(const char *s, char t) {
if (s[0] == '\0') {
return 0;
}
else if (s[0] == t) {
return 1 + more_recursive_fun(s + 1,
t);
}
else {
return more_recursive_fun(s +
1, t);
}
}
In general terms, what does this function do? You only need to
describe what the function does, not how it does it.