Octal forms of integer constants allow compatibility with PDP-11 Fortran. An octal integer constant takes the following form:
"nn
The following examples show valid and invalid octal integer constants and explain why the invalid ones are not valid:
| Valid | |
|---|---|
| "107 | |
| "177777 | |
| Invalid | Explanation |
| "108 | Contains a digit outside the allowed range |
| "1377. | Contains a decimal point |
| "17777" | Contains a trailing quotation mark |
These octal forms are not the same as the typeless octal constants
discussed in Section 2.2.1.4. Integer
constants in octal form have integer data type and are treated as
integers.