#include
#include
using namespace std;
int convertStringtoInt(char *str,int len) {
if(len==1) {
return str[0]-‘0’;
}
cout << str[len-1]-'0' << endl;
return (10*convertStringtoInt(str,len-1)+str[len-1]-'0');
}
int main() {
char str[]=“1234”;
int len=strlen(str);
cout << convertStringtoInt(str,len) << endl;
return 0;
}