Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Demolishun Tbf he asked for a clear definition. Can't get more clearly defined than by the spec, huh
-
@Aman15 Also fuck you for downvoting me. I would rain down on you with the might of zeus, but alas, I'm downvote banned. Damn you, spam bots!
-
@Demolishun i don't think i'll ever understand how (and WHY) that reverse indexing works.
-
@Midnight-shcode 5+3 == 3+5
if &a==5
a[3] == *(a+3) == *(3+a)
array's base address + offset == offset + array's base address
same shit, just from another angle -
@netikras thank you.
still seems weird syntactically, but at least i know how it works now. -
@netikras
Just to be nitpicky:
a[3] == *(a+3) == *(3+a)
That 3 is multiplied by the data type size in bytes. You can see this by printing out the pointer as an integer. Kinda fun to see the work the compiler is doing for you.
Which is interesting because a void pointer will multiply by one. But an array of ints will be multiple bytes in the base increment.
C language
question
arry