The prefix 0xindicates that the next number is in hexadecimal format . those. the base number system 16. Thus, the number 0x18(in the base of 10) (1 * 16 ^ 1) + (8 * 16 ^ 0) = 24 (remember: 16 ^ 0 = 1).
Your example without a prefix is 18already in base 10, as you probably expect.
source
share