4 ms·
I love the first answer to that question. And not just because I wrote it :) A little bit of C trivia: In C, arrays can be indexed like so: a[10] which is ve
by edanm 15y ago
I love the first answer to that question. And not just because I wrote it :)
A little bit of C trivia:
In C, arrays can be indexed like so:
a[10]
which is very common.
However, the lesser known form (which really does work!) is:
10[a]
which means the same as the above.
- djcb 15y agosimilarly, the 'approaches' pseudo-operator: while (i --> 0) { /* do something */ }
- repsilat 15y agoFor some variety, there's also the left-handed "goes to" operator. while (5 <-- x) {} //omits the zero and the much easier to type while (x --- 0) {} //equivalent to the "-->" operator
- cjensen 15y agoTo be clear, it works because X[Y] is a synonym for * (X + Y) Since addition is commutative, * (X + Y) can be rewritten as * (Y + X) which is a synonym for... Y[X]