(ad ,ae ,af) are done for loop ends how a is changed to b and then to c

i am getting confused how the first place in output is updated after forloop is over and all values starting with a ends
(ad ,ae ,af) are done for loop ends how a is changed to b

 int digit = str[i]-'0';
    if(digit == 0 || digit == 1)
     return keypad(str, i +1 , out , j);

    for(int k = 0 ; ch[digit][k] != '\0'; k++){
        out[j] = ch[digit][k];
        keypad(str , i+1 , out , j+1);
    }

suppose input is 23
first digit =2
so a is put at out[0]
then keypad(str, 1, out , 1 ) is called
then digit 3 is extracted
for loop runs and d is added to out[1]
then keypad(str ,2 , out , 2) is called -> base condition is hit here
then for loop for the previous state continious
we get ad, ae , af
then ch[digit][k] != ‘\0’ is true

so for loop ends here
and so then we move to previous call
when i =0 , j = 0 and digit = 2 and k = 1
so we have out[0] = b

similarly bd, be, bf
then cd, ce, cf