Hi so I'm trying to cast/convert a char that I know will always be a number to an int. I'm given a vector of chars, something like charList[2, *, 5] and I pass those values to this function as argValue1 = '2', argValue2 = '5', and argOpperator = '*'. The if statements catch the opperator just fine but the argValue1 * argValue2 comes out to be something like 'Z'.
I can't change the vector to hold something other then char. I'm given the vector but I could convert them before passing them to this function.
When you cast a char to an int like that you get the ASCII value of the number, which isn't equal to the number itself. Often you can just simply do int(some_char - '0') to get the number in the character.