Site Archive (Complete)
C++ Blog: Count Safely
C++
void main(void)

Calls, Returns and In-Between.

by Kevin Carlson
SELECTIVE IGNORANCE

Finding the Signal in the Noise

by Andrew Koenig
March 06, 2007

Count Safely

Typically, querying an array to determine how many elements it contains involves using the sizeof operator, often wrapped in COUNTOF macro. But what happens when COUNTOF gets something it wasn't expecting? The results may surprise you. There is, however, a way to make COUNTOF type-safe. Ivan Johnson shows the way in "Counting Array Elements at Compile Time."

Posted by Kevin Carlson at 01:09 PM  Permalink




 
INFO-LINK


Related Sites: DotNetJunkies, SD Expo, SqlJunkies