18

Possible Duplicate:
Why are Hexadecimal Prefixed as 0x?

Memory addresses are often notated as a hexidecimal value prefixed with 0x. E.g:

> new.env()
<environment: 0x21d36e0>

Does the 0x part mean anything? Where does this notation come from? Is any other value possible instead of 0x?

Community
  • 1
  • 1
Jeroen Ooms
  • 31,998
  • 35
  • 134
  • 207

2 Answers2

28

The 0x is just a notation to let you know the number is in hexadecimal form.

Same as you'd write 042 for an octal number, or 42 for a decimal one.

So - 42 == 052 == 0x2A.

Luchian Grigore
  • 253,575
  • 64
  • 457
  • 625
7

Memory address is usually represented in Hexadecimal Form, 0x is just a notation for Hex number.

Tejendra
  • 1,874
  • 1
  • 20
  • 32