4 AnswersNew Answer
If you are still looking for an answer it is used to convert the numeric characters like '0' '1' '9' etc to integers 0 1 9 and so on. ASCII value of '0' is 48 and if you subtract this value from ascii value of 9 which is 57 you get 57-48=9. So what it basically does is takes a character from '0'-'9' and converts it to integer from 0-9. It isn't useful for alphabets.
http://www.cplusplus.com/reference/string/string/at/ string.at (string.length ()-1) returns the last character of the string. -1 because the method at returns the character at a given position starting at 0. string myName = "Steve"; string c = myName.at (2); c will contain "e" then you put the result of the at function in an int. but the result is a char& , so why put it in an integer. I am not even sure if it works