Converting String to Integer it represents

PROBLEM: https://hack.codingblocks.com/contests/c/205/332

MY CODE: https://ide.codingblocks.com/s/41166

What is wrong with the code I am trying to use, and how do I correct it?

@s.aditya.me
The link to the code https://ide.codingblocks.com/s/41166
does not belong to this question. You have provided code link of different question by mistake.

The approach to this question of converting string to integer is quite simple.

You need to convert the initial character of string to integer, and then call function recursively.
In recursion multiply the previous integer by 10, and add to it the current digit.
Hence you’ll obtain the required integer at last.