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
  • 30,444
  • 34
  • 124
  • 198

2 Answers2

27

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
  • 245,575
  • 61
  • 446
  • 609
7

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

Tejendra
  • 1,784
  • 1
  • 19
  • 32