Just a side note on this - as GCC supports variable length arrays, sizeof will also work at run time for those.