Sujet : Re: Hex string literals (was Re: C23 thoughts and opinions)
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 18. Jun 2024, 05:19:19
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v4r1s7$166bb$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Pan/0.158 (Avdiivka; )
On Mon, 17 Jun 2024 11:42:22 +0200, David Brown wrote:
Most situations where octal could be useful died out many decades ago -
it is vastly more likely that "012" is intended to mean 12 than 10. No
serious programming language supports a leading 0 as an indication of
octal unless they are forced to do so by backwards compatibility, and
many that used to support them have dropped them.
For one example, Python didn’t drop octal numbers in the 2→3 transition,
but it changed the syntax from a simple “0” prefix to having a “0o” prefix
(analogous to “0x” for hex literals) instead.