Code convert string to integer

i tried a lot but not able to do please tell me how to do it

The idea is to convert each character into ASCII format and form the number.
consider a string “12345”
then start traversing the string from backwards like this
5x1+4x10+3X100+2x1000+1x10000
and char can be converted into int like this
str[i]-‘0’
being more precise:
By recursion you will have to take all the digits one by one and then you will have to accumulate them all.
For taking each digits do s[i]-‘0’ to get the integer and accumulate it by multiplying them by power of 10.