Help with site's tutorial on constants

Here's the link for it:
http://cplusplus.com/doc/tutorial/constants.html

Near the beginning of the tutorial, it starts going into octal (8-base) and hexadecimal (?-base) numbers.

Being a person with little to no experience with these sorts of numbers, would someone like to explain how they work and the significance of them in C++?
Last edited on
Both of those, if I'm right, are important to C++ simply because they can tell the computer large numbers without taking up a large amount of characters.

Say for example, I wanted to tell the computer the number '16', it's a small number I know, but it'll work for now, anyway, you can put
0x1 //Use the '0x' to tell the computer that is a hexadecimal number
, and the computer will know that it's sixteen.
Now sixteen is a relatively small number, but this can work for larger numbers, almost any number past sixteen if I'm correct.

If I'm at all incorrect on this, please correct me.
closed account (z05DSL3A)
Octal
http://en.wikipedia.org/wiki/Octal

Hexadecimal
http://en.wikipedia.org/wiki/Hexadecimal
Last edited on
Uh, and also, 0x1 is 1 in decimal...You are thinking of 0xF which is 16 in decimal.
closed account (z05DSL3A)
Q. How many people can read hex if only you and dead people can read hex?

A. 57006
Topic archived. No new replies allowed.