0
String to Int
Is there any function in c++ work like "val" in pascal ? I need to convert a string into an integer. Not a whole number just one by one start from the last character Ex: 12345 start from 5 to 1
4 Respostas
+ 5
Here you can read about the function:
http://www.cplusplus.com/reference/string/stoi/
0
Thank you. But i tried the atoi function.
I have a string "12345"
i want to print each number from the end to the start, but if i do something like
int number=atoi(&string[3]);
output: 45
How i can print one by one number ?