Range (computer programming): Difference between revisions

Content deleted Content added
m Reverting possible vandalism by 134.76.223.16 to version by Bentogoa. False positive? Report it. Thanks, ClueBot NG. (792642) (Bot)
Line 11:
{{Main|Array data type#Indexing notation}}
 
When an array is numerically [[Index (information technology)|indexed]], its range is the upper and lower bound of the array. Depending on the environment, a warning, a [[fatal error]], or unpredictable behavior will occur if the program attempts to access an array element that is outside the range. In some [[programming languages]], such as [[C (programming language)|C]], arrays have a fixed lower bound (zero) and will contain data at each position up to the upper bound (so an array with 5 elements will have a range of 0 to 4). In others, such as [[PHP]], an array may have holes where no element is defined, and therefore an array with a range of 0 to 4 will have ''up to'' 5 elements (and a minimum of 2).
 
== Range as an alternative to iterator ==