gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > Octal numbers

#17898 - StealthElement - Tue Mar 16, 2004 9:51 pm

The prefix 0x notates a hexadecimal, as you all know. Is there a way to notate octals?

#17899 - abilyk - Tue Mar 16, 2004 10:06 pm

The prefix 0 (zero, not the letter O) notates octals.

#17900 - Miked0801 - Tue Mar 16, 2004 10:19 pm

Dear god why do you need to know that - you programming Intellivision/Atari stuff? ;)

#17905 - torne - Wed Mar 17, 2004 12:01 am

Octal's commonly used for a lot of things where three-bit groups make sense. UNIX file permissions are normally expressed in octal, for example, as there are four clusters of three bits (sst rwx rwx rwx) - four neat digits in octal, hard to work out in your head in hex =)

#17972 - StealthElement - Thu Mar 18, 2004 12:36 am

Thanks!