I came across this snippet
template char (&ArraySizeHelper(T (&array)[N]))[N]; #define arraysize(array) (sizeof(Arra
This blog on MSDN precisely describes how it works. Very interesting story. Take a look at it.