Finalsolo963@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 9 months agoLua rulelemmy.blahaj.zoneimagemessage-square3fedilinkarrow-up10arrow-down11file-text
arrow-up1-1arrow-down1imageLua rulelemmy.blahaj.zoneFinalsolo963@lemmy.blahaj.zone to 196@lemmy.blahaj.zoneEnglish · 9 months agomessage-square3fedilinkfile-text
minus-squareAmaltheamannen@lemmy.mllinkfedilinkarrow-up1·9 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].