Memory is reserved for an array of 2048 4-byte integers. How many bytes are rese
ID: 3576444 • Letter: M
Question
Memory is reserved for an array of 2048 4-byte integers. How many bytes are reserved? Memory is reserved for an array of 2048 4-byte integers starting at address 0AC54h. What is the address of the last element of the array. Array arr1 has 512 elements, where each element is a 1-byte character. If the starting address of the array is 0FB68h, what is the address of arr1[367]? Array arr2 has 512 elements, where each element is a 4-byte integer. If the starting address of the array is 0FB68h, what is the address of arr1[367]?Explanation / Answer
1. Memory is reserved for an array of 2048 4-byte integers. How many bytes are reserved.
Each integer takes 4-bytes. And now, 2048 integers takes 2048 * 4 = 8192 bytes.
2. Memory is reserved for an array of 2048 4-byte integers starting at address 0AC54h.
What is the address of the last element of the array.
Each integer takes 4-bytes. And the starting address is: 0AC54h, therefore, the last
element of the array address is: 0AC54h + 007FFh = 0B450h.
3. Array arr1 has 512 elements, where each element is a 1-byte character. If the starting
address of the array is 0FB68h, what is the address of arr1[367].
Each element is a 1-byte character. The starting address is: 0FB68h, therefore, the address
of arr1[367] = 0FB68h + 16E = 0FCD6h.
4. Array ar2 has 512 elements, where each element is a 4-byte integer. If the starting
address of the array is 0FB68h, what is the address of arr1[367].