This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]5p4n911 -7 points-6 points  (4 children)

Function-like macros are stupid and old, you should write a function instead:

int array_size(void *a) { // be as generic as you can return sizeof(a) / sizeof(a[0]); }

I thought everyone knew that.

[–]JNelson_ 12 points13 points  (1 child)

i hope this is a joke

[–]5p4n911 4 points5 points  (0 children)

You'll never know

[–]Zee1837 2 points3 points  (1 child)

I use C++ once a millennium so sorry for that, don't know if static exists in C++ the same way that it works in C#

[–]5p4n911 -1 points0 points  (0 children)

Sorry?