need help and little discussion
Recursion covert string to int
needs a discussion not getting the approach
Here the correct code for converting string to int
Here first we take string from user and then compute its size and calculate multiplication factor m.
In first call we pass string and m (suppose string is 1234 then m will be 1000). There in function we compute l which denotes that we ask recursion to give us int value corresponding to that string starting from index one. Then we convert str[0] to int and then add this after multiplying it by m we add l to it and return the result.
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.