hi, can someone give me an idea on how to convert string to integer using array
for example
string n = '123';
int c;
cout<<c;
and will display 123.
what i think of is 123 divide by 10 or the second idea tat i have is
for example: string s = 123
|1|2|3|
---------
0 1 2
and
s[n-1] = 3
+
s[n-2] = 2 * 10
+
s[n-3] = 1 * 100
=
123
how can i start with?
Code:int stringConIntRec(string number) { if(number.length() == 0) return 0; else { ??????? ??????? } }