Getting an error

this is the code for converting string to integer
my solution–https://ide.codingblocks.com/s/254726

i am getting an error please tell me how to resolve it and why this error is occurring.

also tell if i am applying any wrong approach to solve this problem.

Error is because in line 4, you are using a string pointer. Replace it with int stringtoint(string s,int n)
Also there is some issue with the approach.
Go through this article https://www.geeksforgeeks.org/convert-a-string-to-an-integer-using-recursion/