
Keith B. answered 08/22/19
Software Engineer and Math Geek
My quick answer is to tell you to cast one to the other:
char ch = 'a';
int x = (int)ch;
int y = int(ch);
But I have to wonder if what you're looking for is something more along the line of taking '7' which is the ASCII character seven and you want to convert it to the integer value of 7. If that is the case, then you need to know that the each character digit has an ASCII code value and that they are sequential from 0 to 9. This permits you to do the following:
int val = int( ch - '0');