Arrays start from 0 then 1,2... But why are indexes positive, why are indexes not negative?
closed as off-topic by Gypsy Spellweaver, ncmathsadist, ItamarG3, Ben I.♦ Oct 28 '18 at 18:20
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question does not appear to be about Computer Science education, within the scope defined in the help center." – Gypsy Spellweaver, ncmathsadist, ItamarG3, Ben I.
You are starting with a base memory adress and you are adding an offset having the size of one array element for each following element. This makes adress calculation very easy (base adress + n * size of data structure).
Negative indexes are not allowed because you would refer to the memory adress in front of your base adress, which means you might destroy other variables content.