Sujet : Re: else ladders practice
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.cDate : 03. Nov 2024, 01:26:41
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <6726C341.6030102@grunge.pl>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
Bart wrote:
...
as to this switch as i said the C jas some syntax that resembles switch and it is
[2] { printf("one"), printf("two"), printf("three") }
i mean it is like this compound sometheng you posted
{ printf("one"), printf("two"), printf("three") } [2]
but with "key" on the left to ilustrate the analogy to
swich(n) {case 0: printf("one"); case 1: printf("two"); case 2: rintf("three") }
imo the resemblance gives to think
the difference is this compound (array-like) example dont uses defined keys so it semms some should be added
[n] {{1: printf("one")},{2: printf("two")},{3: printf("three")} }
so those deduction on switch gives the above imo
the question is if some things couldnt be ommitted for simplicity
[key] {'A': printf("one"); 'B': printf("two"); 'C': printf("three"}; }
something like that
(insted of
switch(key)
{
case 'A': printf("one"); break;
case 'B': printf("two"); break;
case 'C': printf("three"}; break;
}