C++ how to convert char array eleements into numbers?

I have a char array with numbers in each element. I need to convert individual elements fron characters into integers to do arithmetic changes. I tried atoi already in this example "atoi(charArray[2])+5" but it did not work. Does anyone know how to get numbers out of char arrays in order to do math... show more I have a char array with numbers in each element. I need to convert individual elements fron characters into integers to do arithmetic changes.

I tried atoi already in this example "atoi(charArray[2])+5" but it did not work. Does anyone know how to get numbers out of char arrays in order to do math with them? Thank you
2 answers 2