Jeff Clough

Stupid C Tricks

I use the C programming language a lot.

Array shenanigans

For a good time, compile and run...


            #include <stdio.h>

            int main(void)
            {
              int wat[10];
              for (int c = 0; c < 10; c++)
                wat[c] = c;
              for (int c = 0; c < 10; c++)
                printf("wat[c] = %i\n", wat[c]);
              for (int c = 0; c < 10; c++)
                printf("c[wat] = %i\n", c[wat]);
            }