Arduino - convert a char to an int
A char is really just a number, which can be seen as a character using the ASCII table. See the reference. The ASCII value you want to get is already in your char b.

If you really need an integer, you can use this:

int b_ascii_value = b;


But a char will probably be enough. Just use b in your calculations, it already is a number.