|
If A[ ] is a one-dimensional array, then A[i] denotes the ith-element in the array A[ ]
|
Each time an array element is used in the program, a small piece of array bound check program code fragment is run.
The array bound check execution can slow down the program considerably.
That's why most programming languages do not provide array bound check by default.
In some languages, you can request the compiler to add array bound check when you develop the program).
Adding array bound check codes in assembler will make the assembler program extremely complex.
Since each data type uses a different number bytes to store their values, consequently:
|
Specifically:
|
Each array element is stored in 1 byte of memory
The array elements are stored in contiguous memory
Each array element is stored in 2 bytes of memory
The array elements are stored in contiguous memory
Each array element is stored in 4 bytes of memory
The array elements are stored in contiguous memory