I am looking to understand the difference between the words index and offset.
I have never seen “offset” in reference to lists/arrays/etc in programming. I have only seen index.
To me, these mean the same thing. But how one is used heavily and one never implies they have different meanings. They might also just have historical or mathematical significance I’m not seeing.
Using the code snippet as a reference:
x = arr; y = arr;
all the below statements are true:
xhas an index of zero
xis offset from the beginning of the array by zero
yhas an index of 2
yis offset from the beginning of the array by 2
This really makes it look like index and offset mean the same thing.