new operator.
25.
It is only in array creation using
new operator
that the values within square brackets mention
the size. In other places, they refer to the indices or subscripts only.
The subscript must be an
integral constant.
26.
The size of the array must be an integer greater than or equal to 0.
After creation of
arrays, the values of the subscripted variables assume default values if there are no initializers.
27.
The array subscripts must always start at zero.
28.
The last array variable’s subscript is always [size -1] (i.e., one less than the size of the
array).
29. You cannot index an array backward (like a[-1], a[-2], etc.).
Also note that it is illegal to
refer to elements that are out of array bounds. For example,
for an array of size 8, the
array bound is from a [0] to a [7] only.The
Do'stlaringiz bilan baham: |