What the problem with base case?
#include<bits/stdc++.h>
using namespace std;
string table[] = { " ", “.+@$”, “abc”, “def”, “ghi”, “jkl” , “mno”, “pqrs” , “tuv”, “wxyz” };
void keypad(char *str,int i,int a,int j){
///base case
if(str[a]==’\0’||str[i]==’\0’||table[i][j]==’\0’||table[i]=="\0"){
return;
}
///recursive case
int x=str[i]-'0';
int y=str[a]-'0';
cout<<table[x][i]<<table[y][j]<<endl;
keypad(str,i,a,j+1);
keypad(str,i+1,a+1,0);
}
int main(){
char str[100];
cin>>str;
keypad(str,0,1,0);
}