Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. For each of the following structure declarations, determine the offset of eac

ID: 3729121 • Letter: 1

Question

1. For each of the following structure declarations, determine the offset of each field, the total size of the structure, and its alignment requirement for x86-64. See Practice problem 3.44 of page 275 for reference. I's best if you write C code to answer the question. struct P1 struct P2 struct P3 struct P4 struct Ps char a; int b; char c; int d; ; long a; char b; int c; char d; ; char a[2]; short b[5]; ; char *a[4] short b[3] struct P2 a; struct P3 b[3]; ; offset total size alignment requirement

Explanation / Answer

a b c d total size

p1 1 4 1 4 16

p2 8 1 4 1 24

p3 2 10 12

p4 32 6 40

p5