3 ms·
Ah! I saw that #define but didn't see the bit about failing on C++ objects that overload operator[]. I don't do C++ much so that really didn't occur to me. I p
by mikeash 14y ago
Ah! I saw that #define but didn't see the bit about failing on C++ objects that overload operator[]. I don't do C++ much so that really didn't occur to me.
I personally prefer sizeof(*(arr)), which is the same as arr[0], but I suppose C++ lets you overload that as well.