Keypaid phone problem

not getting output of problem

@guptashubham210a use character array (output)

why can’t we use string for this?

kwhy can’t we use string for this?

@guptashubham210a in char array you have fixed size like you can access any index inside the size but in string you declared simply output="" so you can directly do output[j] you have to append which will make it very complex

in string also we can replace elements with some other na like char output[j]=ch; llike this so why not?

kin string also we can replace elements with some other na like char output[j]=ch; llike this so why not?

You have defined string like this string output="" so it’s empty if you want to use it the allocate it with some fixed space

@ vatsal38
how to do this allocation fixed??

@guptashubham210a for string do this

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.