Skip to content

Mike's home page

Year: 2013

C array subscript weirdness

2013-09-202013-09-20 by mike

$ 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 reading
Posted in Programming

Generic makefile for easily building 1 file programs

2013-09-182013-09-18 by mike

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 reading
Posted in Programming

author unkown

2013-06-282013-06-28 by mike

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
Posted in Quotes

Categories

  • Amusement
  • Computing
    • Apps
    • Programming
      • 2 cent tips
      • CS 371P
      • emacs
      • scripts
      • shell
  • Diving
  • Misc
  • Quotes
  • Science
  • Trading

Archive

  • 2019
  • 2018
  • 2017
  • 2016
  • 2015
  • 2014
  • 2013
  • 2012
  • 2011
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • 2002
  • 1999
© 2025 Mike's home page | Powered by WordPress | Theme: responsive-kubrick by Glam.Ink