Thread Links | Date Links | ||||
---|---|---|---|---|---|
Thread Prev | Thread Next | Thread Index | Date Prev | Date Next | Date Index |
Yes, a 0 prefix means octal in C and C++. In C 99 it's in section 6.4.4.1 Integer Constants:
octal-constant:
0
octal-constant octal-digit
. . .
An octal constant consists of the prefix 0 optionally followed by a sequence of the
digits 0 through 7 only.
There are also octal escape sequences in character constants and therefore also in string literals:
octal-escape-sequence:
\ octal-digit
\ octal-digit octal-digit
\ octal-digit octal-digit octal-digit
Octal isn't heavily used anymore, but at the time of the early implementations of C and Unix octal was very common. The first Unix was on the DEC PDP-7 / PDP-9 which had an 18 bit word - a multiple of 3 not 4 bits.
I used to be able to do octal arithmetic in my head, but now I'd like to see it dropped. That's difficult - first it would have to be debated by both standards committees for 010 years then deprecated for 0100 years.
- Ian McIntosh IBM Canada Lab Compiler Back End Support and Development
John Pryce ---07/12/2013 06:03:08 AM---On 12 Jul 2013, at 08:42, Vincent Lefevre wrote: >> I think that this phrase from the text is suffic
| John Pryce <j.d.pryce@xxxxxxxxxx> |
| Ian McIntosh/Toronto/IBM@IBMCA |
| 07/12/2013 06:03 AM |
| Re: Motion 46: finalise interval literals |