# 0xbeef to integer

Netty poestel

Ranch Hand

Posts: 131

Chris Allen

Ranch Hand

Posts: 127

posted 11 years ago

Exactly.

You should recognize that a numeric literal that begins with 0 is octal (base 8), and one that begins with 0x is hexadecimal (base 16). In hexadecimal, the letters a, b, c, d, e, and f are used to represent base-10 values 10, 11, 12, 13, 14, and 15 respectively.

(Note: The "x" can be either upper or lowercase -- just like an "L" to denote long, an "s" to denote short, or an "e" to denote exponent.)

You should recognize that a numeric literal that begins with 0 is octal (base 8), and one that begins with 0x is hexadecimal (base 16). In hexadecimal, the letters a, b, c, d, e, and f are used to represent base-10 values 10, 11, 12, 13, 14, and 15 respectively.

(Note: The "x" can be either upper or lowercase -- just like an "L" to denote long, an "s" to denote short, or an "e" to denote exponent.)

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." *~Joe Strummer*

sscce.org