Hexadecimal

This is a discussion on Hexadecimal within the C++ Programming forums, part of the General Programming Boards category; I was wondering if anyone here could give me a good site that teaches me hexadecimal that I often see ...

It keeps going on from there. Basically you just have to know that each "power of" is to 16 instead of 10, just as binary is a power of 2 for each place. As for the reason why its not in caps, it usually doesn't matter in programming but in electronics in 7 segment LCD displays you can only display b and d in lowercase otherwise they would look like 8 and 0.

Random hexadecimal comments...

As bennyandthejets said, Hex is used as an alternative to binary. Everything inside the compurer is done and stored in binary.

Hex is most-often used when the number is being used as a bit-pattern rather than "just a number." So, you would generally be using bitwise operations with hex... It is rare to use addition & subtraction, etc. It is also quite common to use hex for addresses. ...So, you might use addition and subtraction with hex addresses.

There are two reasons for avoiding the direct use of binary - When you get beyond one byte (8-bits), binary gets difficult to read... you have to start counting bits. And, it's not easy to use binary directly in C / C++... You can't use binary in your source code.

The reason that hex is used in place of decimal, is that it is much easier to convert between binary and hex than between binary and decimal. If you learn 14 conversions (you already know zero and one), you can convert numbers of any size in your head!

The built-in Windows calculator can convert between hex/decimal/octal/binary.
Start->Programs->Accessories->Calculator->Scientific->Hex.

The 0x notation is to tell the C / C++ compiler that the number is hex. Different computer languages use different notation.

Good try on the code tags... you forgot the slash in the closing tag [/code].