# What does the prefix 0x mean in hexadecimal?

## Recommended Posts

What does the prefix 0x (as in 0x565) mean in the hexadecimal numeral system? What is this prefix for?

##### Share on other sites
*nix (UNIX and related) shells, and likewise the C programming language, which was designed for UNIX (and the syntactical descendants of C[2]) use the prefix 0x for numeric constants represented in hex:

Wiki

looks like to denote the following number is hex

hope this helps

##### Share on other sites

It's a prefix to indicate the number is in hexadecimal rather than in some other base. The C programming language uses it to tell the compiler "this is hex, not some meaningless letters and numbers."

##### Share on other sites

Ok I get it now. Thanks a lot for the explanation guys!

##### Share on other sites

0[0-7]+ : Octal

int Piano = (0xCDEFAB); // hexadecimal (0x..)

int Zero = (00); // octal (0..)

int JamesBond = (.007); // decimal (.xxx)


Edited by khaled

##### Share on other sites

IMHO, it is debatable all this

## Create an account

Register a new account