Re:C++17 creates a practical use of the backward array index...
by jbverschoor on Monday April 03, 2023 @04:22PM
(#35430721)
I’ve never seen that before. Luckily
[ Parent
| on HN ]
Re:C++17 creates a practical use of the backward array index...
by olliej on Monday April 03, 2023 @04:25PM
(#35430752)
He was also a tutor/TA and I think mostly used it to explain how pointers vs. indexing worked. Or possibly to traumatize students :D
Re:C++17 creates a practical use of the backward array index...
by int_19h on Monday April 03, 2023 @07:17PM
(#35432724)
It is extremely rare even in ancient C code. The only reason why it exists in C at all is because rewriting a[i] as *(a+i) was inherited by C from B; the latter only has a single machine word type for everything, so there was no way to define it such that a[i] would be legal but i[a] would be illegal in B.