Convert the hex digits to their corresponding int values (as in '0' to 0, 'A' to 10, etc). Now, you can compute your desired result by doing an 16 * a + b, where a and b are the int variables.