C compilers transform myArray[i] into *(myArray + i), which is equivalent to *(i + myArray) which is equivalent to i[myArray]. Experts know to put this to good use. To really disguise things, generate the index with a function:This looks like a rather bad joke, but who knows all the ways of C compiler...
int myfunc(int q, int p) { return p%q; }
...
myfunc(6291, 8)[Array];
1 comments:
The next snippet was a very popular idiom among my (former) ACM ICPC team:
for(int i = 0; i < n; ++i)
printf(!i+" %d", a[i]);
printf("\n");
I recall first time I used it my teammate was all "WTF?" =)
Post a Comment