Generate string acode

my code ----> https://ide.codingblocks.com/s/478428

sir i don’t understand why we took input array as char and later changing into digit and then typecasting for ascii values, when we are getting input as numbers so why don’t we extract every digit of input from integer array of input from left to right and then typecasting it for ascii values .
secondly, i am trying to eliminate the input 0 but it is still giving unwanted character .

we can easily extract digit from right (by taking mod with 10) but it is not simple to extract digit from left

this is because we you try to make 2digit no then it count 0 as well
to avoid this you can use return here like this

if (inp[i]=='0'){

        return generate_string(inp,out,i+1,j);

    }

Modified code