Jump to content
seriously disabled

What does the prefix 0x mean in hexadecimal?

Recommended Posts

*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 this post


Link to post
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 this post


Link to post
Share on other sites

0x[0-9|A|B|C|D|E|F]+ : Hexadecimal

 

0[0-7]+ : Octal

 

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

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

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

Edited by khaled

Share this post


Link to post
Share on other sites
Guest SerDikov

IMHO, it is debatable all this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.