1. Assume a 64 bit system, where the sizeof all pointers are 8 bytes, and sizeof
ID: 3903537 • Letter: 1
Question
1. Assume a 64 bit system, where the sizeof all pointers are 8 bytes, and sizeof (int) is 4 byte. The following questions refer to the code below: void f (void) struct int_array i int* data; int len; struct int_array arr; struct int_array* arr_ptr-&arr; struct int_array arrs[1001; (a) What are the initial values of arr.data and arr.len (b) What is sizeof (struct int_array)? (c) What is sizeof (arr_ptr)? (d) What is sizeof (arr_ptr->data)? (e) What is sizeof (arrs)? () Suppose the address of arrs [0] is 0x1000, what is the address of arrs [50]? (g) Suppose the address of arrs [50] is 0x1500, what is the address of arrs [201? h) Suppose the address of arrs [50]->len is 0x1500, what is the address of arrs [50]->data?Explanation / Answer
If you have any doubts, please give me comment...
a) NULL 0
b) 16
c) 8
d) 8
e) 1600
f)1320 (1000+320 = 1320)
g) 1320 (1500 - 1E0 = 1320)
h) 1318 (1500 - 1E8 = 1318)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.