Question: ***PLEASE SHOW ALL WORK, DO NOT JUST CIRCLE AN ANSWER!!!*** 11. Following is a definition of a widget and a declaration of an array A
***PLEASE SHOW ALL WORK, DO NOT JUST CIRCLE AN ANSWER!!!***

11. Following is a definition of a widget and a declaration of an array A that contains 10 widgets. The sizes of a byte, short, int, and long are 1, 2,4, and 8 bytes, respectively. Alignment is restricted so that an n-byte field must be located at an address divisible by n. The fields in a struct are not rearranged; padding is used to ensure alignment. All widgets in A must have the same size struct widget short s byte b long 1 int i end widget widget A[10] Assuming that A is located at a memory address divisible by 8, what is the total size of A, in bytes? (A) 150 (B) 160 (C) 200 (D) 240 (E) 320 11. Following is a definition of a widget and a declaration of an array A that contains 10 widgets. The sizes of a byte, short, int, and long are 1, 2,4, and 8 bytes, respectively. Alignment is restricted so that an n-byte field must be located at an address divisible by n. The fields in a struct are not rearranged; padding is used to ensure alignment. All widgets in A must have the same size struct widget short s byte b long 1 int i end widget widget A[10] Assuming that A is located at a memory address divisible by 8, what is the total size of A, in bytes? (A) 150 (B) 160 (C) 200 (D) 240 (E) 320
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
