I have been battling to improve my code by turning it into an array. I started by creating many "items" manually and manipulating them in the code. "For item number 1 do this. For item number 2 do this". As you would expect, it worked successfully and I had a smile.
Then I started improving my code by turning the many "items" into members of an array, and manipulating them as an array. Much better code, obviously. However, my (innocent, newbie) question is, am I correct in saying that an array ALWAYS assumes and expects and dictates that you are starting at zero and not 1?
The reason I ask is that my list of items that I created was from 1 to 25, but I could not get my array code to work properly with them. But when I tricked my array to see them as 0 to 24 it all worked successfully.
Is my assumption about arrays correct?
Thanks.
Then I started improving my code by turning the many "items" into members of an array, and manipulating them as an array. Much better code, obviously. However, my (innocent, newbie) question is, am I correct in saying that an array ALWAYS assumes and expects and dictates that you are starting at zero and not 1?
The reason I ask is that my list of items that I created was from 1 to 25, but I could not get my array code to work properly with them. But when I tricked my array to see them as 0 to 24 it all worked successfully.
Is my assumption about arrays correct?
Thanks.