Liste des Groupes | Revenir à cl c |
On 04.11.2024 12:56, Bart wrote:I mean that the question came down to this. After all he had already decided on that second form rather than the first, and had acknowledged that the 'else's were missing.[...]Erm, no. The question was even more specific.
>
Here, the question was, can:
>
if (c1) s1;
else if (c2) s2;
>
always be rewritten as:
>
if (c1) s1;
if (c2) s2;
It had (per example)That too!
not only all ci disjunct but also defined as a linear sequence of
natural numbers! - In other languages [than "C"] this may be more
important since [historically] there were specific constructs for
that case; see e.g. 'switch' definitions in Simula, or the 'case'
statement of Algol 68, both mapping elements onto an array[1..N];
labels in the first case, and expressions in the latter case. So
in "C" we could at least consider using something similar, like,
say, arrays of function pointers indexed by those 'n'.
I'd suggest that by just pointing it out.)
I'm a bit astonished, BTW, about this huge emphasis on the topic
"opinions" in later posts of this thread. The OP asked (even in
the subject) about "practice" which actually invites if not asks
for providing opinions (besides practical experiences).
Les messages affichés proviennent d'usenet.