Smart Keypad - I

Hello Sir/Ma’am,
how to resolve stoi is not declared error??
Also why it shows error, comparison between signed and unsigned integer when comparing with size of string? how to resolve this?
And in my code i used 2 for loops along with recursion, is this approach fine? or do i have to think of some other approach where for loops are not used at all? Sharing my code::

hi
the stoi function work for the whole string not for a character
u can try by doing
char c=‘4’ cout<<stoi© it will gave error

  1. why it shows error, comparison between signed and unsigned integer when comparing with size of string—>it is not error this is warning it come because the when u declare int i it can be negative or positive but length of string is always positive so it generate a warning that u are comparing 2 diff type u can try using unsigned int instead of int

3 the approach is right

Ok sir, so could you please suggest me any alternative to stoi that would work in this code?

simplly do
char c=s[n-1]
then
int digit=c-‘0’
this will convert a particular index of string into its correspond digit

Okay, Got it. Thank you!!!