Having problem with my code. i keep getting an error towards the bottom of the code. i need the user to enter a word. and with that word convert it to numbers. once i have convert it if it is bigger than 20 i have to add the two digits together and get print out the array that response to it.
example" ALEX
A=1
L=12
E=5
X=23
1+12+5+23= 41 //since its bigger than 20 you add 4 and 1 together so it will be 5. after that you print the 5th element of array
My one line example on the first post you did is hard to read, sure, but if you did some research, std::accumulate adds all values in a stl container (like a string), and I used lambdas for its prend.
The first parameter in the lambdas is the sum (x), the second is the value of the current element (y).
Hopefully now you understand how to put this into loop form.
Just remember to keep your code as short, neat, and as c++ as possible. Like use for(int letter_value: some_string), and for the love of god properly space your code, you can use a plugin in your ide to format it for you, like for code::blocks there's AStyle.