2 ms·
> Because C does not have real arrays C does have real arrays, they just get implicitly converted to pointers to their first element in a lot of cases (for a m
by Arch-TK 4y ago
> Because C does not have real arrays
C does have real arrays, they just get implicitly converted to pointers to their first element in a lot of cases (for a multitude of reasons in part having to do with simplifying the language), A[B] is defined as such so it works with normal pointers and arrays-converted-to-pointers in the same manner.
Try using an array with sizeof, unary &, or in the form of a string literal used to initialise an array. In those situations it suddenly stops behaving like a pointer to its first element and definitely behaves like something which is unlike anything else in C (hint: it's an array).