3 ms·
In C, and this article seems to be almost exclusively about C, a[b] is basically sugar for (*((a) + (b))) C does actually have arrays (don't let people tell yo
by tialaramex 2y ago
In C, and this article seems to be almost exclusively about C, a[b] is basically sugar for (*((a) + (b)))
C does actually have arrays (don't let people tell you it doesn't) but they decay to pointers at ABI fringes and the index operation is, as we just saw, merely a pointer addition, it's not anything more sophisticated - so the arrays count for very little in practice.
- juped 2y agoNot just basically sugar, the classic parlor trick is doing 3[arr] or whatever
- catlifeonmars 2y agoParty trick? That’s just good coding style. I even have that enabled as a lint rule /s