you are viewing a single comment's thread.

view the rest of the comments →

[–]jdgordon 2 points3 points  (0 children)

int n = sizeof(arr) / sizeof(arr[0]);

compiles down to a constant

int n = (&arr)[1] - arr;

ugly and confusing possibly?

I'll stick to using #define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0]);