Finalsolo963@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 8 months agoLua rulelemmy.blahaj.zoneimagemessage-square3fedilinkarrow-up10arrow-down10file-text
arrow-up10arrow-down1imageLua rulelemmy.blahaj.zoneFinalsolo963@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 8 months agomessage-square3fedilinkfile-text
minus-squareAmaltheamannen@lemmy.mllinkfedilinkarrow-up1·8 months agoThe reason for the convention is that it used to be just a pointer (adress) to consecutive elements in memory. A[x] is then literally translated to the adress of A + sizeof(x)*x. Meaning that the first element is at A[0].
The reason for the convention is that it used to be just a pointer (adress) to consecutive elements in memory. A[x] is then literally translated to the adress of A + sizeof(x)*x. Meaning that the first element is at A[0].