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 requirementExplanation / 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
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.