Sujet : Re: do { quit; } else { }
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 13. Apr 2025, 22:52:28
Autres entêtes
Organisation : None to speak of
Message-ID : <87plhfg25f.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.13 (Gnus v5.13)
Michael S <
already5chosen@yahoo.com> writes:
[...]
The funny thing is that in original C prefix form of [] indexing was
equivalent to the postfix form. May be, it still is in C23, I didn't
try to look in the docs or test.
However in type declarations one always had to use only postfix form.
If you're referring to the equvalence of a[i] and i[a], that's still
there in C23. I wouldn't call either of them "prefix form".
The standard classifies indexing as a postfix operator. You can think
of it as postfix, where a is the operand and [i] is the operator, or as
an operator that takes two operands and uses a weird syntax that's not
really either prefix, postfix, or binary:
operand1 '[' operand2 ']'
But you make an interesting point: the imperfect mapping of expressions
to declarations does not include the case where the prefix of [] is an
integer. (And I definitely don't have a problem with that.)
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */