Code dumped, segmentation fault

#include
using namespace std;
void codes(char* input,int i, char* output,int j){
//base case
if(input[i]==’\0’){
output[j]=’\0’;
cout<<output;
cout<<endl;
return;
}

//recursive case
int fd=input[i]-‘0’;
char ch=‘a’+fd-1;
output[j]=ch;
codes(input,i+1,output,j+1);
if (input[i+1]!=’\0’){
int i= input[i+1]-‘0’;
int sd= fd*10+i;
if(sd<=26){
char sh= ‘a’+ sd - 1;
output[j]=sh;

codes(input,i+2,output,j+1);
}

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

hi @uvanshika please refer this


ive commented it

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.