3 ms·
A better simple rule: always use sizeof on typename. That always works therefore you can use typedef arrays too.
by agazso 17y ago
A better simple rule: always use sizeof on typename. That always works therefore you can use typedef arrays too.
- rikthevik 17y agoTotally agree. If you start relying on the subtle behaviour of sizeof, it's just asking for a world of trouble. It's so easy to get mixed up with whether it's going to return the length of the array, the size of the elements in the array, the total number of bytes the array is using or the size of the pointer. Come to think of it, I think that's completely scope dependent and depends on whether the array has lots its array-ness. I have no idea. :)