I am not able to do backtracking for this code how does the return statement works in base case?

#include
using namespace std;
string keys []={"",“abc”,“def”,“ghi”,“jkl”,“mno”,“pqrs”,“tuv”,“wxyz”};

void phone(char* input,int i,char* output,int j){

//base case
if(input[i]==’\0’){
output[j]=’\0’;
cout<<output<<" ";
return;
}

//recursive case
int digit=input[i]-‘0’;
for(int k=0;keys[digit][k]!=’\0’;k++){
output[j]=keys[digit][k];
phone(input,i+1,output,j+1);
}

}

int main() {
char input[100];
cin>>input;
char output[100];
phone(input,0,output,0);
}

hi @uvanshika i saw u got 100 points still having issue?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.