$ cat test.c #include <stdio.h> int main() { int a[2]; a[0]=0;a[1]=0; 1[a] = 1; // weirdness printf(“%d %d\n”,a[0], a[1]); } $ gcc -o test test.c $ ./test 0 1 The subscript operator is commutative for what ever reason. *(a + 1) < => a[1] < => 1[a]
Continue readingYear: 2013
Generic makefile for easily building 1 file programs
I’ve always found myself writing short little programs to test out an idea or learn how a language feature/bug works. Often they’re throw away programs, once finished they’re no longer needed. So often it ends up being test.c/test.cpp/test.java etc. But sometimes I like to keep it around so they’ll end up with a meaningful name […]
Continue readingauthor unkown
Great minds discuss ideas, average minds discuss events, and little minds discuss people. Widely credited to Eleanor Roosevelt but if you keep digging that’s not clear.
Continue reading