#define ARRAY_SIZE(x) ((sizeof x) / sizeof *(x))
But ideally there would be a builtin to do this, since this gives nonsense results if you pass a pointer instead of an array. #define ARRAY_SIZE(x) ((sizeof x) / sizeof *(x))
But ideally there would be a builtin to do this, since this gives nonsense results if you pass a pointer instead of an array.No comments yet.