Smart keypad -1

I don’t known what is wrong with my code:-
#include
#include
using namespace std;
string table[] = { “”, “.+@$”, “abc”, “def”, “ghi”, “jkl” , “mno”, “pqrs” , “tuv”, “wxyz” };
void recursive(int i,char *a,char *b,int j)
{
if(a[i]==’\0’)
{
b[j]=’\0’;
cout<<b<<endl;
return;
}
int z=(int)a[i]-48;
if(z==0)
{
recursive(i+1,a,b,j);
//return;
}
for(int k=0;table[z][k]!=’\0’;k++)
{
b[j]=table[z][k];
recursive(i+1,a,b,j+1);
}
return;
}
int main()
{
char a[12];
char b[12];
cin>>a;
int z=strlen(a);
a[z]=’\0’;
recursive(0,z,a,b,0);
// mobileKeypad(a,b,0,0);
return 0;
}

https://ide.codingblocks.com/s/54689

pls help

paste your code on coding blocks IDE and share the link here with problem link

https://ide.codingblocks.com/s/54689

you are not using 0 as ’ '.
you are using 0 as ‘’.
https://ide.codingblocks.com/s/54817 //Corrected code
Hit like if u get it.
See line no 15

1 Like

you are providing space for zero isn’t that wrong ?

It is mention in question 0 as ’ '.Read problem statement .

1 Like

C

1 Like

ok I got it, thanks for the help

1 Like