Review needed in question to convert string of integer to integer

#include
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<math.h>

using namespace std;

int convert(char *a,int n)
{

if(n==0)
{
return (*a-‘0’) ;
}

int ans= (*a-‘0’)*pow(10,n)+convert(a+1,–n);

return ans;
}

int main()
{

char str[]="543322";

cout<<convert(str,sizeof(str)-2)<<endl;
}

Please save your code on ide.codingblocks.com and then share its link.

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.