Re:Comp.lang.c Frequently Asked Questions
by tialaramex on Monday September 13, 2021 @04:03AM
(#28508945)
Excellent point, that largely contradicts my earlier position in fact. I was thinking of an array of chars and should have considered that's only a special case.
Make sure to be careful and realize that sizeof my_array returns the number of bytes that my_array uses, not the number of elements. An array of 10 ints likely has sizeof == 40, while indexing past 9 would be undefined behavior.