I think you get the hexvalue notation in C++ wrong. Yes, you put 0x in front of a number to indicate that it is a "number written in hexadecimal notation". Notice that it is a notation to write numbers down. Writting c == 59 will be the same as c == 0x3b. So it is just the same number, whether you write it in hex or not. Putting 0x in front of a variable name will result in a syntax error. 0x (and 0X) are only needed when you want to write down numbers in hexadecimal notation.