Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Suppose a is an integer array name, then the byte address of element a[4] is _ _ _ _ _ _.
Suppose a is an integer array name, then the byte address of element a[4] is _ _ _ _ _ _.
First of all, if a stands for the array name, then a is equivalent to the address of the first element of the array, which is the address of a[0]. Arrays are continuously stored in memory in a linear manner, namely, a[0], a[ 1] and A [2]. The address of an element can be calculated by adding the offset to the first address, that is, the address of a[i] = the address of a [0]+the number of bytes occupied by the array element type.

So:

Byte address of a[4] = address of a [0] +4 * number of bytes occupied by array element type = a+4 * number of bytes occupied by plastic type = a+4 * 4 = a+ 16.

Strictly speaking, this question should give the word length of the computer. 16-bit and 32-bit computers have different results. The above results are the results of a 32-bit computer. At this time, the number of bytes occupied by the plastic type is 4. If the number of bytes occupied by plastic type is 2 for 16-bit computer, the answer should be a+4 * 2 = a+8.