Recursion conert string to integer please help i dont know what is wrong

#include
#include<string.h>
using namespace std;
int myAtoiRecursive(string *str, int n)
{
// Base case (Only one digit)
if (n == 1)
return *str - ‘0’;

// If more than 1 digits, recur for (n-1), multiplu result with 10 
// and add last digit 
return (10 * myAtoiRecursive(str, n - 1) + str[n-1] - '0'); 

}

// Driver Program
int main(void)
{
#include
#include<string.h>
using namespace std;
int myAtoiRecursive(char *str, int n)
{
// Base case (Only one digit)
if (n == 1)
return *str - ‘0’;

// If more than 1 digits, recur for (n-1), multiplu result with 10 
// and add last digit 
return (10 * myAtoiRecursive(str, n - 1) + str[n-1] - '0'); 

}

// Driver Program
int main(void)
{ int n;
cin>>n;
string str[n] ;
for(int i=0;i<n;i++)
{
getlin(cin,str);
}

cout<<myAtoiRecursive(str, n);
        return 0; } 

this is my code

Hello,
The problem is with your input format.

int n;
cin>>n;
string str[n] ;
for(int i=0;i<n;i++)
{
getlin(cin,str);
}

What is n? Do you have to read multiple string ?
Please, read the question properly.

Modification:
string str;
getlin(cin,str);

Hope, this would help.
Give a like if you are satisfied.