While refactoring code and ridding myself of all those #defines that we\'re now taught to hate, I came across this beauty used to calculate the number of elements in a struc
Windows specific:
There is the macro _countof() supplied by the CRT exactly for this purpose.
_countof()
A link to the doc at MSDN