Dave's Brain

Browse - Programming Tips - I see ARRAYSIZE() is used in some MSDN sample code but I don't have it.

Date: 2009apr6
Language: C/C++

Q.  I see ARRAYSIZE() is used in some MSDN sample code but I don't have it.
What should it look like?

A.  Like this:

#define ARRAYSIZE(_a) (sizeof((_a)) / sizeof((_a)[0]))

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.