Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to code string to int converter c++

string str;
int ans = 0;
int currPower = 0;
for(int i = str.size()-1; i >= 0; i--){
	ans += (str[i] - '0') * pow(10,currPower);
    currPower++;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #code #string #int #converter
ADD COMMENT
Topic
Name
9+9 =